Purpose:Get running total Using Analytical Function
select empno,
ename,
sal,
deptno,
sum(sal) over(partition by null ORDER BY EMPNO RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) Running_Total
from scott.emp
order by empno
ename,
sal,
deptno,
sum(sal) over(partition by null ORDER BY EMPNO RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) Running_Total
from scott.emp
order by empno
No comments:
Post a Comment