Check the following table:
--------------------------------
ID Value GroupName
--------------------------------
1 10 A
2 12 B
3 19 A
4 5 B
5 9 A
6 12 B
7 17 C
8 21 C
9 8 C
10 15 A
--------------------------------
I want to have the following output:
-------------------------
A B C
-------------------------
10 12 17
19 5 21
9 12 8
15 NULL NULL
-------------------------
So, all values in 'GroupName'
field will become a new column.
Does anyone know how to do this in SQL 2008?
Thank you.