我正在尝试构建一个预定的查询,但有些事情正在触发错误,而且不清楚是什么问题。事件安排对我来说有点新鲜,但我还有很多其他工作,所以我缺少一些信息:
DELIMITER //
CREATE EVENT gen_firstJoins
ON SCHEDULE EVERY 1 HOUR
ON COMPLETION PRESERVE
DO BEGIN
CREATE TEMPORARY TABLE tmp_joins SELECT username, MIN(player_join) AS player_join FROM joins GROUP BY username ORDER BY player_join ASC ;
TRUNCATE joins_first;
INSERT INTO joins_first (username, player_join) SELECT username, player_join FROM tmp_joins GROUP BY username ORDER BY player_join;
END//
DELIMITER ;
错误:
错误1064(42000):您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在'ame,MIN(player_join)附近使用正确的语法AS player_join FROM在第6行加入GROUP BY用户名ORDER BY playe'
答案 0 :(得分:0)
在评论中回答,所以将评论重新发布为答案Re:https://meta.stackexchange.com/questions/90263/unanswered-question-answered-in-comments
您可能有隐藏的字符/换行符等?
只需选择并删除整个作品“用户名”(在SELECT之后)并尝试重新输入。