Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Correlated update 1

Status
Not open for further replies.

hallux

Programmer
Feb 25, 2003
133
US
Hello,
Looking for help structuring the subquery in a correlated update.

UPDATE rainfall SET system = 'METRIC'
WHERE
(SELECT * FROM rainfall, location
WHERE rainfall.city_id = location.city_id AND location.country = 'CANADA')

-Hallux

 
I think what you want is:
Code:
UPDATE rainfall SET system = 'METRIC'
WHERE city_id IN
(SELECT city_id FROM location WHERE country = 'CANADA');
 
That is eactly what I needed.
Thank you.
-Hallux
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top