After a little search to this case, i found this method that called correlation update
This is how we can do it:
UPDATE table1 tbl1 SET (name, desc) = (SELECTtbl2.name,tbl2.desc FROM table2tbl2 WHEREtbl1.id =tbl2.id) WHERE EXISTS ( SELECT 1 FROM table2tbl2 WHEREtbl1.id =tbl2.id )
No comments:
Post a Comment