I have a table Dev with the data below
YYYMMDD Atest BTest CTest
20150525 100 200 300
20150526 110 210 310
20150527 120 220 320
I need output like below
xyz 20150525 201050526 20150527
Atest 100 110 120
BTest 200 210 220
CTest 300 310 320
How can i achieve above result set. My table Dev will grow and i need the result set table to build columns dynamically and display the data as required. Any help is appreciated. If you suggest pivot, may i know what field should i use for aggregation and how to use it. Thanks.