
Originally Posted by
seannie
When I'm writing an update sql statement, I want to update the gender and country ids in the member table by entering their corresponding value in both the gender table(eg.male/female) and country table(eg.ireland/england/france/etc.)
Code:
UPDATE members
SET genderid =
( SELECT id
FROM genders
WHERE gendername = 'male' )
, countryid =
( SELECT id
FROM countries
WHERE countryname = 'canada' )
WHERE id = 937
although why you're doing this on an UPDATE instead of on the original INSERT is weird
Bookmarks