SQL Server 2022 introduced the GENERATE_SERIES()
function that allows us to create a series of values that increment between a given start and end point.
We can create a decrementing series simply by having a greater start point than the end point, while omitting the third argument.
We can also create a decrementing series by using a negative value for the third argument. This obviously requires that the start point is higher than the stop point.
Continue reading