I have one table which contain 3 column,Col_ID, Col_Group, Col_Price for this my column is like below
Col_ID Col_Group Col_Price
1 AA 0
1 BB 2000
1 CC 1000
2 AA 0
2 RR 3000
2 DD 4000
2 EE 0
and I want to make transpose or rows to column like as below
col_ID group1 Price1 group2 Price2 Group3 Price3 Group4 Price4
1 AA 0 BB 2000 CC 1000
2 AA 0 RR 3000 DD 4000 EE 0
I use PIVOT And trued below query
SELECT * FROM tbl1 PIVOT ( SUM(Col_Price) FOR Col_Group IN ('AA','BB','CC','DD','EE','RR'))
I got table But I Want as above mention. please Help me
ORDER
yourCol_Group
in the row