Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an event that runs every 24 hours?

Tags:

mysql

events

I need this to be run every 24 hours:

delete tags from tags left join tagowners on tags.id=tagowners.tagId
where tagowners.tagId is null;
like image 657
Newbie Avatar asked Nov 14 '09 06:11

Newbie


1 Answers

CREATE EVENT cleartags
    ON SCHEDULE EVERY 24 HOUR
    DO 
      delete tags from tags left join tagowners on tags.id=tagowners.tagId
    where tagowners.tagId is null;
like image 70
Newbie Avatar answered Sep 30 '22 05:09

Newbie