MySQL: return updated rows

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

    There is a faster version of the return of updated rows, and more correct when dealing with highly loaded system asks for the execution of the query at the same time on the same database server

    update table_name WITH (UPDLOCK, READPAST)
    SET state = 1
    OUTPUT inserted.
    

提交回复
热议问题