Scalar Functions — Window
Window functions compute values relative to neighboring rows within a result set. All five dialects support the full set of KQL window functions — they map directly to standard SQL window function syntax using OVER () clauses.
Legend: ✅ Supported · ⚠️ Approximated · ❌ Not Supported · 🔄 Rewritten
| Function | SQLite | MySQL | ClickHouse | PostgreSQL | DuckDB | Notes |
|---|---|---|---|---|---|---|
row_number() | ✅ | ✅ | ✅ | ✅ | ✅ | row_number() OVER () |
rank() | ✅ | ✅ | ✅ | ✅ | ✅ | RANK() OVER () |
dense_rank() | ✅ | ✅ | ✅ | ✅ | ✅ | DENSE_RANK() OVER () |
prev() | ✅ | ✅ | ✅ | ✅ | ✅ | LAG() OVER () |
next() | ✅ | ✅ | ✅ | ✅ | ✅ | LEAD() OVER () |
row_cumsum() | ✅ | ✅ | ✅ | ✅ | ✅ | SUM() OVER (ROWS UNBOUNDED PRECEDING) |
row_rank() | ✅ | ✅ | ✅ | ✅ | ✅ | DENSE_RANK() OVER (ORDER BY col) |