I have an issue with getting select sub-queries to work on an UPDATE. I\'m trying something like the following:
UPDATE
UPDATE foo SET bar=bar-1 WHE
In some cases you can also take advantage of the MySQL variable. e.g.:
SET @id1 = (SELECT id FROM foo WHERE name = 'parent'); UPDATE foo SET parent_id = @id1 WHERE name = 'emails';