What is a window function?hard
Answer
It calculates across related rows without collapsing them.
Explanation
Window functions use OVER with optional PARTITION BY and ORDER BY for rankings, running totals, moving averages, and row comparisons.
Follow-upWhat is the difference between RANK and ROW_NUMBER?