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 |
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-08-25 : 08:08:29
|
| iam having a table where i need to update three column values into one column value.how can i do thisUPDATE EMRUNCODEDMEDICATIONSLKUP SET UNCODED_MEDICATION = (SELECT (isnull(MEDICATION,'') || ' ' || isnull(STRENGTH,'') || ' ' || isnull(DOSAGE,'')) FROM EMRUNCODEDMEDICATIONSLKUP) |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-25 : 08:17:56
|
| SELECT (isnull(MEDICATION,'')+ ' ' + isnull(STRENGTH,'') + ' ' + isnull(DOSAGE,''))FROM EMRUNCODEDMEDICATIONSLKUP |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-25 : 08:18:11
|
| Use + instead of ||MadhivananFailing to plan is Planning to fail |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-08-25 : 08:18:40
|
| NO THIS I HAVE TO UPDATE INTO A NEWLY ADDED COLUMN |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-25 : 08:18:46
|
MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-25 : 08:20:45
|
quote: Originally posted by rajasekhar857 NO THIS I HAVE TO UPDATE INTO A NEWLY ADDED COLUMN
Too difficult UPDATE EMRUNCODEDMEDICATIONSLKUPSET NEW_COL=(isnull(MEDICATION,'')+ ' ' + isnull(STRENGTH,'') + ' ' + isnull(DOSAGE,''))MadhivananFailing to plan is Planning to fail |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-08-25 : 08:24:46
|
| working fine thanks iam little bit overthinking rather than going in a smooth way |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-25 : 08:27:52
|
quote: Originally posted by rajasekhar857 working fine thanks iam little bit overthinking rather than going in a smooth way
Also you are confusing with SQL Server and Oracle queries MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|