given the following information I have in a database table:
Col 1, Col2, Col3
1 , x , G
1 , y , H
2 , z , J
2 , a , K
2 , a , K
3 , b , E
What can I do in Linq (as I’m using Entity Framework) to get the following:
1 , x , G
1 , y , H
2 , z , J
2 , a , K
3 , b , E
You get the idea, I can do it in SQL just fine with the following:
Select Col 1, Col 2, Col 3
from Table
group by Col 1, Col 2, Col 3
No Idea how to do it in code as I can only find a way to do a distinct on one column.
Try this :
Or alternately :