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 |
kkiranvr
Yak Posting Veteran
54 Posts |
Posted - 2009-04-22 : 13:11:38
|
I have a table and it is having 2 columnsCol1 Col2120 390124 null138 null140 450Now i want the o/p as Col1 Col2120 390124 124138 138140 450Can any one suggest how to achieve this?-Thanks N Regards,Chinna. |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2009-04-22 : 13:13:34
|
???update tblset Col2 = Col1where Col2 is null==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-22 : 13:19:21
|
OrSELECT Col1, COALESCE(Col2, Col1) AS Col1FROM Table1 E 12°55'05.63"N 56°04'39.26" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2009-04-22 : 13:33:29
|
Ah - o/p = output.(s.b. "AS Col2" :) )==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-22 : 13:36:49
|
Thanks! I missed that one...SELECT Col1, COALESCE(Col2, Col1) AS Col2FROM Table1 E 12°55'05.63"N 56°04'39.26" |
|
|
|
|
|