Data engineering and IT

Window function

  • Data engineering and IT

Definition

A SQL calculation over a set of rows related to the current row, such as a running total or a rank, that keeps every row instead of grouping them into one.

Example

Raket Parts B.V. monthly revenue with a running total for 2025:
January €3,334,779, running total €3,334,779
February €4,216,570, running total €7,551,349
March €5,839,574, running total €13,390,923
SELECT month, revenue, SUM(revenue) OVER (ORDER BY month) AS running_total FROM monthly_revenue;

Raket Parts B.V. is a fictional company created for Insyt.

For your role

Choose your role to see what this term means in your work.

Why it matters

Running totals, ranks and comparisons with the previous row become one line of SQL instead of complex self-joins.

Where it is used

SQL analysis and reporting. Used by data analysts, BI developers and data engineers.