Glossary · Data Analytics
What is Window Function?
A SQL function that calculates across related rows without collapsing them into one row.
In more detail
Used for rankings (ROW_NUMBER, RANK, DENSE_RANK), running totals (SUM() OVER) and comparisons with previous rows (LAG, LEAD). A favourite interview topic.
Example
Top 3 products by revenue in each category with DENSE_RANK() OVER (PARTITION BY category …).
Learn it properlySQL for Data Analysis: GROUP BY, JOINs and Window Functions13 min lesson · Data Analytics