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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-06 : 08:37:05
|
| Hari writes "I want to update a column that is having NULL values. Value for this column is obtained from another table. I would like to update this coulmn only if the returned value is non NULL. If the returned value is NULL, I don't want to update NULL column again with a NULL. What will be the SQL for this.update person aset a.age=(SELECT b.age FROM person_age b WHERE a.id = b.id)where a.age is null This SQL will update person even if the return value is NULL." |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-01-06 : 08:39:15
|
will this do?update person aset a.age=(SELECT b.age FROM person_age b WHERE a.id = b.id and b.age is not null)where a.age is nullGo with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|