Skip to content
Advertisement

I have a result set of continuous days and a severity rating. I would like to aggregate these into StartDate, EndDate, Severity

In SQL Server I have a table with the following data

i would like to obtain an aggregate of the dates and the severity

Advertisement

Answer

I am guessing this is really a gaps-and-islands problem. If so:

This will get adjacent rows with the same severity.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement