Can someone help me with Mysql with a query?

0

Sorry for the inconvenience I am developing a systems of events.

The detail is that I have a table exclusively to control all the events, what I am trying to do is eliminate the already expired rows, every so often with the Mysql query.

This is my Query.

CREATE EVENT delete_producto
 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 hour
DO
  DELETE 
    FROM tickero 
   WHERE duracion < NOW()

This query does everything right, but the problem is when it completes its elapsed time the code disappears eliminating the data that were already expired. What I want is that the query does not disappear and that it automatically runs again after every hour so on.

Is there any way to put automatic and rerun?

    
asked by Alex 17.02.2018 в 18:45
source

1 answer

0

try replacing

ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 hour

for

ON SCHEDULE EVERY 1 HOUR

Here you can find more information link

    
answered by 17.02.2018 в 19:54