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 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2009-03-31 : 14:55:14
|
| I have a query which results the required outputCol1 Col2 Col3 Col4---- ---- ---- ----- T1 T2 T3 55Output:Col---T1T2T355 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2009-03-31 : 15:10:01
|
| This would work :Select Col1 from myTableUNION ALLSelect Col12 from myTableUNION AllSelect Col13 from myTableUNION ALLSelect Col14 from myTableJack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2009-03-31 : 15:20:45
|
| Thanks |
 |
|
|
buzzi
Starting Member
48 Posts |
Posted - 2009-03-31 : 15:41:57
|
| another waySELECT Colfrom yourtableUNPIVOT(col FOR Col IN(col1,col2,col3,col4)) as pvt |
 |
|
|
|
|
|