Mysql
 sql >> Database >  >> RDS >> Mysql

Come posso creare un lavoro o un evento in mysql

Usa l'Event Scheduler di MySQL :

DELIMITER ;;

CREATE EVENT foo ON SCHEDULE EVERY DAY STARTS '2012-10-05 00:00:00' DO BEGIN
  UPDATE table1 SET Status = 'Accepted' WHERE Status = 'Pending';
  UPDATE table2 SET Status = 'Accepted' WHERE Status = 'Pending';
END;;

DELIMITER ;