2012-06-06 93 views
1

錯誤#1064每週定期事件自己做錯了什麼即時通訊做請建議我一些很好的教程,目前下面的MySQL文檔事件創建在MySQL

#1064 - 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 'DO BEGIN INSERT INTO week_stats (profileid,likes,dislikes,ragepoints) SELECT id' at line 3 


DELIMITER $$ 
CREATE EVENT week_stats 
ON SCHEDULE EVERY WEEK 
DO 
BEGIN 
INSERT INTO week_stats (id,likes,dislikes,points) 
SELECT id,likes,dislikes,points FROM profile; 
END $$ 
DELIMITER ; 

MySQL的版本5.1.61-0ubuntu0.11.10.1

+0

請發佈錯誤信息 – Quassnoi

回答

1

語法不正確。您必須在EVERY子句中指定時間間隔,例如 - '每1周'或'每2周'。

CREATE EVENT Syntax