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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update column where is null

Author  Topic 

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2014-02-08 : 02:26:23
hi
i have a two table

select*from phon

phone ASA
111 james
222 stivens
333 null
444 null


select*from t2

phone ASA
111 james
222 stivens
333 jacke
444 lee

select*from phon where ASA is null

333 null
444 null

how i make update
table phon column ASA only ASA is null

after update table phon
for example
select*from phon


phone ASA
111 james
222 stivens
333 jacke
444 lee


http://sql-az.tr.gg/

bitsmed
Aged Yak Warrior

545 Posts

Posted - 2014-02-08 : 05:31:17
Try this:
update phon
set ASA=t2.ASA
from t2
where phon.ASA is null
and t2.phone=phon.phone
Go to Top of Page

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2014-02-10 : 03:44:58
thank you very much

http://sql-az.tr.gg/
Go to Top of Page
   

- Advertisement -