MySQL: return updated rows

后端 未结 6 644
既然无缘
既然无缘 2020-12-03 01:28

I am trying to combine these two queries in twisted python:

SELECT * FROM table WHERE group_id = 1013 and time > 100;

and:



        
6条回答
  •  无人及你
    2020-12-03 02:05

    This is really late to the party, but I had this same problem, and the solution I found most helpful was the following:

    SET @uids := null;
    UPDATE footable
       SET foo = 'bar'
     WHERE fooid > 5
       AND ( SELECT @uids := CONCAT_WS(',', fooid, @uids) );
    SELECT @uids;
    

    from https://gist.github.com/PieterScheffers/189cad9510d304118c33135965e9cddb

提交回复
热议问题