22-25 April 2026
Video unavailable
SQLBits 2022

An Introduction to Window Functions

Learn to use window functions to improve your SQL
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 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 SQL Server for our examples, but content will be adaptable to other dialects of SQL.