Window Functions
Ranking, top-N per group, LAG and running totals
50 min · interactive lesson with runnable code and 6 graded exercises.
What you'll be able to do
- Explain how a window differs from GROUP BY
- Pick ROW_NUMBER, RANK or DENSE_RANK based on how ties should behave
- Write top-N per group and latest-row-per-key with a CTE
- Compute period-over-period change, running totals and moving averages
The full lesson is free with an account.