Categories
SQL

Data Segmentation in SQL using Window Functions

Sometimes you want to segment records. It may be splitting a customer base for marketing purposes, or segmenting a user base for a new feature. Good segmentation makes clean divisions in the data. In this post we’ll see a way to achieve that with a great deal of help from Window Functions. This post was […]

Categories
SQL

Cleaning Up Window Functions in SQL Server 2022

Window functions allow us to perform a function across a set of rows in a result set, rather than how we might typically group them. In SQL Server 2022 we have a new clause available for our queries which can help tidy up how these are defined. We’ll use the sample table from the introduction to […]