betweenGo

SQL Update in One Table Based on Values in Another Table

by on Jul.02, 2008, under Oracle

Dolphin Crest on Flickr

(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);


Share

Related posts:

  1. SQL Insert in One Table Based on Values in Another Table
  2. SQL Delete in One Table Based on Values in Another Table
  3. SQL*Plus Commit on Exit
  4. Microsoft Office 2008 update 12.1.0 will not install
  5. Update Profile in ATG Commerce

:

Leave a Reply

 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!