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 |
Rick_Boston
Starting Member
5 Posts |
Posted - 2009-03-19 : 21:04:05
|
Hi i want to populate a new column with 2 existing ones For example The old table looks like thisColumn1 Column2 hello1 hello2 hello3 hello4 hello5 hello6 The new table to look like thisNewColumnHello1Hello2Hello3Hello4Hello5Hello6 I want to merge the old two columns into one new column, the old columns need to go line by line in the new columshope this makes senceThanks Rick B |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-03-19 : 22:52:35
|
Take a look in Books Online for "UNPIVOT", it does just what you're looking for. |
|
|
Rick_Boston
Starting Member
5 Posts |
Posted - 2009-03-20 : 08:06:54
|
ok thanks Rick B |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-20 : 10:02:09
|
or simply doSELECT ColFROM(SELECT Column1 AS Col FROM TableUNION ALLSELECT Column2 FROM Table)tORDER BY Col |
|
|
|
|
|