With a relationship with this question How UPDATE and SELECT at the same time and with this code:
UPDATE table SET foo=1 WHERE boo=2
SELECT * from table WHERE foo=1 AND boo=2
How can I UPDATE and SELECT at the same time with MySQL?
It seems the person asking the existing question uses PostgreSQL. How can I do that in MySQL? It seems there is no returning
command in MySQL.
Unfortunately, RETURNING is not supported by MySQL and therefore you need to write separate statements.
As an alternative, you can rely on a stored procedure.
The question of whether MySQL has a returning clause equivalent, in general, was addressed here: Mysql returning clause equivalent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With