Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

update column where is null Expand / Collapse
Author
Message
Posted Saturday, February 08, 2014 12:41 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, February 10, 2014 2:38 AM
Points: 30, Visits: 68
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
Post #1539475
Posted Saturday, February 08, 2014 1:05 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 10:37 PM
Points: 319, Visits: 1,142
update t1 set
t1.Asa = t2.asa
From phone
Inner join table2 on t2.phone=t1.phone
Where t1.asa is null

Should do it.


__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1539477
Posted Monday, February 10, 2014 1:44 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, February 10, 2014 2:38 AM
Points: 30, Visits: 68
thank you veruy much
Post #1539650
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse