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 query

Author  Topic 

pnpsql
Posting Yak Master

246 Posts

Posted - 2012-02-14 : 05:08:51

hi team , i have following two tables

abc like col1(pk) col2 col3
1 cc xx
2 aa dd
3 bb jj

abc1 col1(fk from abc) col2
1 zz

need to update abc1.col2 with same value as in abc.col2 and abc.col1 = 1

challenge everything

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-14 : 05:14:48
update t1
set col2 = t2.col2
from abc1 as t1
inner join abc as t2 on t2.col1 = t1.col1


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -