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 |
|
anujpratap84
Starting Member
45 Posts |
Posted - 2012-04-11 : 04:36:09
|
| Hi All,I want to pivot my resultant table.Below is the sample result set.Sno RN Tran Sale SPG Group1 12 12 44 55 512 18 14 47 59 563 13 12 44 55 54 12 12 44 5 565 12 12 44 55 2I want to transform the tableThen Sno 1 2 3 4 5 will be the column Please helpAnuj Pratap Singh |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-12 : 00:35:03
|
| what all values you need to pivot? can you show how output will be for above data?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
anujpratap84
Starting Member
45 Posts |
Posted - 2012-04-12 : 01:13:17
|
I want output like below format.Sno 1 2 3 4 5Rn 12 18 13 12 12Tran 12 14 12 12 12Sale 44 47 44 44 44......quote: Originally posted by visakh16 what all values you need to pivot? can you show how output will be for above data?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Anuj Pratap Singh |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
vinu.vijayan
Posting Yak Master
227 Posts |
Posted - 2012-04-12 : 05:34:00
|
| Try this link For Pivot/Unpivot:[url]http://msdn.microsoft.com/en-us/library/ms177410.aspx[/url]Look at the examples. Hope that would help.Vinu VijayanN 28° 33' 11.93148"E 77° 14' 33.66384" |
 |
|
|
|
|
|