Updating a column after expiration of specific time in MySQL
3
votes
2
answers
19616
views
1. I have a table where I have a column named
state(int(2))
and modify_time
(time_stamp
on update current timestamp).
2. I have an update trigger which changes the value of state column to 0
based on some condition.
3. I want to set the value of state
column to 1
after 24 hours of modify_time
, if it is still 0
.
4. 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?
Asked by simplifiedDB
(679 rep)
May 29, 2013, 06:58 AM
Last activity: Dec 16, 2016, 04:37 PM
Last activity: Dec 16, 2016, 04:37 PM