Perform calculations across a set of rows related to the current row.
Perform calculations across a set of rows related to the current row, without collapsing rows like GROUP BY does. Essential for running totals, rankings, moving averages, and row comparisons. Not supported by MySQL before 8.0.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | 8.0 | Added in MySQL 8.0 |
| PostgreSQL | ✓ Supported | 8.4 | Supported since PG 8.4 |
| SQL Server | ✓ Supported | 2005 | Since SQL Server 2005 |
| Oracle | ✓ Supported | 8i | Since Oracle 8i |
| SQLite | ✓ Supported | 3.25.0 | Added in SQLite 3.25.0 |
Includes ranking, aggregate, and value functions like LEAD and LAG.
Added in MySQL 8.0
Supported since PG 8.4
Since SQL Server 2005
Since Oracle 8i
Added in SQLite 3.25.0