22-25 April 2026

From Ranking to Rolling Totals: Windowing Functions Explained

Proposed session for SQLBits 2026

TL; DR

Learn how to use SQL Server windowing functions to create rankings, running totals, and rolling averages. This session makes complex queries simple and gives you practical skills you can use right away.

Session Details

If you write SELECT statements in SQL Server, windowing functions are a game changer. They make queries faster, cleaner, and far more powerful. In this session, we’ll break down the theory, show you the process visually, and demonstrate the output. From ROW_NUMBER and RANK to LEAD and LAG, you’ll learn how to add totals, sub-totals, variances, and rolling averages with ease. Whether you need running totals or comparisons to previous rows, you’ll leave knowing how to write windowing functions that make it happen.

3 things you'll get out of this session

A clear understanding of what windowing functions are and why they matter. Practical techniques for using ROW_NUMBER, RANK, LEAD, LAG, and more. The ability to create running totals, rolling averages, and comparisons with confidence.

Speakers

James McGillivray

jimbabwe.co.za