I am trying to create a Stored procedure (or query expression) that Pivots on a grouping ID. After looking at the examples here and elsewhere I have failed to get my pivot statements to work in a stored procedure, and I am looking my help.
Also, if this could be done with LINQ on a LIST that would be a solution for me also.
theID theGroup theValue
1 2 Red
2 2 Blue
3 2 Green
1 3 10
2 3 24
3 3 30
1 4 1
2 4 2
3 4 3
the Group #2 means a CHOICE, the group # 3 means COUNT, the Group #4 means SORT so I want to name those columns (I realize this is a shortcoming of PIVOT but that's OK).
ID CHOICE COUNT SORT
1 Red 10 1
2 Blue 24 2
3 Green 30 3