DELIMITER $$

DROP EVENT IF EXISTS delete_name $$

CREATE DEFINER=`root`@`LOCALHOST`
EVENT `delete_name`
ON SCHEDULE EVERY 10 MINUTE starts now()
ON COMPLETION NOT PRESERVE ENABLE
DO
BEGIN
DELETE FROM CLTX_SOFS WHERE STR_TO_DATE(CONCAT('2017-07-07',' ','11:30:00'),'%Y-%m-%d %H:%i:%s') < (NOW() - INTERVAL 10 MINUTE);
END $$

最佳答案

顺便提一下,

STR_TO_DATE(CONCAT('2017-07-07',' ','11:30:00'),'%Y-%m-%d %H:%i:%s')


相当于

'2017-07-07 11:30:00'

关于mysql - 我想在MYSQL中每10分钟执行一次此事件,但是没有任何人建议,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44964354/

10-13 04:33