MySQL: return updated rows

后端 未结 6 637
既然无缘
既然无缘 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:26

    Apparently mysql does have something that might be of use, especially if you are only updating one row.

    This example is from: http://lists.mysql.com/mysql/219882

    UPDATE mytable SET
    mycolumn = @mycolumn := mycolumn + 1
    WHERE mykey = 'dante';
    
    SELECT @mycolumn;
    

    I've never tried this though, but do let me know how you get on.

提交回复
热议问题