22-25 April 2026

An Introduction to Window Functions

Proposed session for SQLBits 2026

TL; DR

An introduction to window functions in SQL from fundamentals through to performance and advanced patterns.

Session Details

For anyone with a basic understanding of SQL or beyond, window functions are a key feature to open your querying options and take your code to the next level.
Most functions are like a holiday in Vegas, what goes on in a row stays in a row, but window functions throw the curtains wide open, making the rows in your queries aware of what happens around them.
In this session we'll start with the basics of syntax and simple examples such as sequencing rows and aggregating over different levels, then move on to more advanced uses including running totals, common query patterns and tricks Finally we'll consider performance impacts for better and worse.
We'll use T-SQL for our examples, but content will be transferable to Fabric, Spark, Snowflake and beyond.

3 things you'll get out of this session

To understand what a window function is and to use them. To learn patterns of usage that solve common challenges with data. To understand performance issues and optimisations to apply when using window functions.