首页 > 代码库 > COUNT
COUNT
COUNT({ * | [ DISTINCT | ALL ] expr }) [ OVER (analytic_clause) ]
SELECT ENAME,
E.HIREDATE,
COUNT(EMPNO) OVER(ORDER BY HIREDATE RANGE BETWEEN 30 PRECEDING AND 30 FOLLOWING) AS CNT
FROM EMP E
WHERE TO_CHAR(HIREDATE,‘YYYY‘)=‘1981‘;
ENAME HIREDATE CNT
---------- ----------- ----------
ALLEN 1981/2/20 2
WARD 1981/2/22 2
JONES 1981/4/2 2
BLAKE 1981/5/1 2
CLARK 1981/6/9 1
TURNER 1981/9/8 2
MARTIN 1981/9/28 2
KING 1981/11/17 3
FORD 1981/12/3 3
JAMES 1981/12/3 3
COUNT
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。