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 $$
答案 0 :(得分:0)
顺便提一下,请注意
STR_TO_DATE(CONCAT('2017-07-07',' ','11:30:00'),'%Y-%m-%d %H:%i:%s')
相当于
'2017-07-07 11:30:00'