22-25 April 2026
Video unavailable
SQLBits 2026

Window functions in SQL Server - brush up your skills

Wether you're a newbie or a seasoned developer, now is the time to brush up your window function skills. Get to know this "advanced" toolset in order to ease and optimize the development of your data analysis queries in T-SQL.
Window functions usually are considered "advanced SQL", and while they're part of the language standard, SQL Server does not implement all of them. Version 2022 brought at least a small feature update worth looking at and in 2025 we get a new aggregate function, so it's about time time to brush up our knowledge.

You will learn when and how how to use those OVER, PARTITION and ORDER clauses. From aggregate and ranking to statistical and offset functions, this session walks you through all that SQL Server offers, up to the new actual WINDOW clause. The demos will show real world applications, such as sliding means, running totals, string aggregates and even the popular "gaps and islands" problem.

Once you've got the hang of it (right after this session), it will become clear that window functions are not overly complicated, but ease the development of data analysis in T-SQL, and in the optimal case even bring a performance advantage over conventional methods.