SELECT deptnum, empnum, COUNT(salary)
OVER (PARTITION BY deptnum ORDER BY empnum ROWS 3 PRECEDING)
FROM persnl.employee;
•
Return the running count of employees within each department:
SELECT deptnum, empnum, COUNT(*)
OVER (PARTITION BY deptnum ORDER BY empnum ROWS UNBOUNDED PRECEDING)
FROM persnl.employee;
496
OLAP Functions