I have a query whose result set looks like the below table.
The Name column has a "C1, C2, C3" set which is well known
Id | Name | Value
-------------------------------
1 | C1 | 1C1
1 | C2 | 1C2
1 | C3 | 1C3
2 | C1 | 2C1
2 | C2 | 2C2
2 | C3 | 2C3
I need to transpose it to the following
Id | C1 | C2 | C3
-------------------------------
1 | 1C1 | 1C2 | 1C3
2 | 2C2 | 2C2 | 2C3
Tried to achieve it with Pivots but they don't seem to play nice for string values (i.e.) non-aggregates. Any pointers on how I can go about this ?
MAX()is an aggregate that can work with strings and there's no point in providing special facilities for when the developer happens to know that each aggregate will only receive one row's value.