How to UPDATE and SELECT at the same time in MySQL

后端 未结 1 731
无人共我
无人共我 2020-12-17 22:56

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 WHE         


        
1条回答
  •  孤城傲影
    2020-12-17 23:34

    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

    0 讨论(0)
提交回复
热议问题