Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
shabad
Starting Member
9 Posts |
Posted - 2009-04-17 : 13:22:36
|
Hi I need to transpose data in Sql 2000, can some one help meEg: Item cp amntA R1 10A R2 10B R1 4B R2 5I need this to be formatted likeItem R1 R2A 10 10B 4 5Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-04-17 : 13:46:30
|
[code]SELECT Item,MAX(CASE WHEN cp='R1' THEN amnt ELSE NULL END) AS R1,MAX(CASE WHEN cp='R2' THEN amnt ELSE NULL END) AS R2FROM tableGROUP BY Item[/code] |
|
|
|
|
|