SQL Update in One Table Based on Values in Another Table
by Frank Kim on Jul.02, 2008, under Oracle
(Photo: Dolphin Crest by jurvetson)
I was wondering how to do this and thankfully someone wrote up a nice article on the SQL update statement.
Here is their example of how to do this.
UPDATE suppliers SET name = ( SELECT customers.name FROM customers WHERE customers.id = suppliers.id) WHERE EXISTS ( SELECT customers.name FROM customers WHERE customers.id = suppliers.id);
Related posts:
