Window Function
Noun · Development
Definitions
A SQL function that performs a calculation across a set of rows related to the current row, without collapsing them into a single result (unlike GROUP BY). Functions include ROW_NUMBER(), RANK(), LAG(), LEAD(), SUM() OVER(), and running totals. The PARTITION BY clause defines groups and ORDER BY defines the window frame.
In plain English: SQL functions that can look at surrounding rows while keeping every row in the result — like having GROUP BY without actually grouping.
Example: "SELECT name, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) — ranks employees within each department without losing individual rows."