Skip to content
Advertisement

SQL Group by date with multiple same results

How to write a statement that groups data by date but shows when data changed for the first time

date – when data changed

a,b,c – some data and it can be anything

This is should be the result. It might have the same data on different dates, but it missing the next day when data stayed the same.

It should work on MS SQL Server 2008 r2

Advertisement

Answer

This is like a gaps and islands problem.

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