Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- moving sum (cumulative sum using analytical function)
- SELECT
- employee_id,
- salary,SUM(salary) OVER(partition BY department_id ORDER BY employee_id) AS cume_sum,
- department_id
- FROM hr.employees;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement