尝试在mysql中创建每日事件:
CREATE EVENT ResetStatus
ON SCHEDULE
EVERY 1 DAY
DO
BEGIN
IF (DATE('2013-04-05') = CURDATE()) THEN
UPDATE mytable
SET resetstatus = 1
WHERE id = (SELECT pid FROM usertable WHERE priority = 'A');
END IF;
END;
收到错误:
Lookup Error - MySQL Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 12
如果我接受更新语句并放入TOAD并运行,它运行时没有错误。