SQL Select when data changes
c#, entity-framework, sql
Solution
List<int> list=...;
var result=Enumerable.Range(0, list.Count- 1)
.Where(x=> x== list.Count-1 || list[x]!=list[x+1])
.Select(x=>list[x]);
Problem
I'd like to retrieve an integer value in a SQL Select but only when the data changes, e.g.: Table data: ``` 50 50 50 52 50 30 30 35 30 30 60 65 60 60 ``` Now I'd like to get this data: ``` 50 52 50 30 35 30 60 65 60 ``` Executing a distinct query, this would not work for me because it would retrieve: ``` 50 52 30 35 60 65 ``` Any ideas? I'm working with Entity Framework and C#, so suggestions using them would also be appreciated! Thanks.