The SQL spec allows an UPDATE statement to have a 'RETURNING' clause, which will (I think) do exactly what you want. Unfortunately it's not implemented in MySQL. It's been in Postgres since version 8.2 and is documented here.
In reply to Re: getting the ids of records affected by an input statement
by grantm
in thread getting the ids of records affected by an input statement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |