A Slice of Time

This page serves as a compendium for all blog posts dedicated to the my talk entitled A Slice of Time: Window Functions in SQL Server.

A Slice of Time: Ordered Set Function(s)

This is part six in a series on window functions in SQL Server. One of a Kind: The Ordered Set Function As of SQL Server 2019, there is only one ordered set function: STRING_AGG(). I like STRING_AGG() a lot, especially because it means my days of needing to explain the STUFF() + FOR XML PATH […]

A Slice of Time: Statistical Functions

This is part five in a series on window functions in SQL Server. Reviewing the Statistical Functions The next set of window functions we will look at are the statistical functions. There are four of them: PERCENT_RANK(), CUME_DIST(), PERCENTILE_CONT(), and PERCENTILE_DISC(). PERCENT_RANK and CUME_DIST PERCENT_RANK() is a fairly straightforward function: rank each window based on […]

A Slice of Time: Offset Functions

This is part four in a series on window functions in SQL Server. Offset Functions in SQL Offset functions are another class of window function in SQL Server thanks to being part of the ANSI SQL standard. Think of a window of data, stretching over some number of rows. What we want to do is […]

A Slice of Time: Ranking Functions

This is part three in a series on window functions in SQL Server. The Original Windows Last time around, we looked at aggregate window functions, which I think are the easiest for someone brand new to the concept to understand. Today, we’ll shift to the first window functions introduced to SQL Server in 2005: ranking […]

A Slice of Time: Aggregate Functions

This is part two in a series on window functions in SQL Server. Last Time on 36 Chambers In the prior post, we looked at the anatomy of a window function and said that it looks kind of like this: Now we’re going to look at a specific class of window functions: aggregate functions. I […]

A Slice of Time: Overview

This is part one in a series on window functions in SQL Server. What is a Window Function? A window function is, quite simply, a function applied over a window of data. If that doesn’t sound impressively reductionist, I don’t know what will. So let’s unpack this a little bit further. A window function operates […]