4 ms·
it wont work with a timestamp because each write will have an affected row of 1 beacuse the writes happen at different times. setting a boolean is static
by tylergetsay 3y ago
it wont work with a timestamp because each write will have an affected row of 1 beacuse the writes happen at different times. setting a boolean is static
- jayd16 3y agoYou can do something like UPDATE row SET timeout = NOW() WHERE NOW() - taskTimeout > row.timestamp. You're not stuck with comparing bools.
- twic 3y agoupdate tasks set taken_timestamp = now() where task_id = ? and taken_timestamp is null
- AdamJacobMuller 3y agoupdate row set taken=true,taken_by=my_id,taken_at=now() where taken is false;