Wednesday, January 26, 2011

Update table from another table

UPDATE table1
SET
col1 = B.col1
, col2 = B.col2
, col3 = B.col3
from table2 B
where B.col4 = table1.col4 and B.col5 = table1.col5
and exists (select 1 from table2 where table2.account = table1.account and table2.memo_number = table1.memo_number )

No comments:

Post a Comment