SELECT
DEPTNO,
ENAME,
SAL,
SUM(SAL) OVER (PARTITION BY DEPTNO ORDER BY SAL,ENAME)
CUMDEPTTOT,
SUM(SAL) OVER (PARTITION BY DEPTNO)
DEPTTOTAL,
SUM(SAL) OVER (ORDER BY DEPTNO,
SAL) CUMTOT,
SUM(SAL) OVER () TOTSAL
FROM
SCOTT.EMP
ORDER BY
DEPTNO,
SAL
No comments:
Post a Comment