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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 update by joining table

Author  Topic 

rajesha
Starting Member

36 Posts

Posted - 2003-01-07 : 09:16:41
i have 2 tables
in table1 fields are sno,phonenum,name
in table2 fields are sno and phonenum

i want to update phonenum in table1 with phonenum in table2 curresponding to sno

how can i write a single query to update phonenum in table1 by joins or anyother way

can anybody help me


robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-01-07 : 09:21:23
UPDATE T1
SET PhoneNum=T2.PhoneNum
FROM Table1 T1 INNER JOIN Table2 T2
ON T1.SNO=T2.SNO

Edited by - robvolk on 01/07/2003 09:21:47
Go to Top of Page
   

- Advertisement -