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 |
|
ranjana
Starting Member
1 Post |
Posted - 2012-11-27 : 13:02:02
|
| Hi ,I have two columns in a table that have value likecolumnname(a,b,c,d)value(1,2,3,4)now i need output likecolumnname valuea 1b 2c 3d 4please suggest need full. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-11-27 : 13:03:51
|
| never mind, I misread your post!JimEveryday I learn something that somebody else already knew |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-11-27 : 13:11:15
|
| here we godeclare @table table( a int,b int,c int,d int)insert into @tablevalues(1,2,3,4)select * from (select a,b,c,d from yourTable )pUNPIVOT (value for columnName in (a,b,c,d) ) as unpvtJimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|
|
|