SQL Window Functions
viaGlassdoor
Question: Write a SQL query using window functions (e.g. ROW_NUMBER, RANK, or running aggregates via OVER/PARTITION BY). Approach: Use OVER (PARTITION BY ... ORDER BY ...) to compute per-group rankings or running totals without collapsing rows via GROUP BY, e.g. ROW_NUMBER() OVER (PARTITION BY category ORDER BY value DESC) to rank rows within each category while retaining all original rows.
asked …