Updating a column after expiration of specific time in MySQL
-
31-10-2019 - |
Question
I have a table where I have a column named
state(int(2))
andmodify_time
(time_stamp
on update current timestamp).I have an update trigger which changes the value of state column to
0
based on some condition.I want to set the value of
state
column to1
after 24 hours ofmodify_time
, if it is still0
.I tried below method to test :
CREATE EVENT myevent1 ON SCHEDULE AT current_timestamp + interval 1 minute DO UPDATE test.mytabletable SET state = 0;
This did not doing anything. Is there any alternative method?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange