I am trying to combine these two queries in twisted python:
SELECT * FROM table WHERE group_id = 1013 and time > 100;
and:
So what you're trying to do is reset time
to zero whenever you access a row -- sort of like a trigger, but MySQL cannot do triggers after SELECT
.
Probably the best way to do it with one server request from the app is to write a stored procedure that updates and then returns the row. If it's very important to have the two occur together, wrap the two statements in a transaction.