我有一个非常简单的要求:
SELECT * FROM players;它起作用并显示“玩家”列表。 现在,如果我在名为“groups”的表上执行完全相同的请求,则会出现语法错误
SELECT * FROM groups;错误代码:1064。您的SQL语法有错误; 检查与MySQL服务器版本对应的手册,以便在第1行0.000秒的“组”附近使用正确的语法
如果我做 :
SELECT * FROM mydb.groups;它有效,如果我这样做:
SELECT * FROM `groups`;它也有效。
i have a very simple request :
SELECT * FROM players;which works and show a list of "players". Now if i do the exact same request on my table named "groups" i get a syntax error
SELECT * FROM groups;Error Code: 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 'groups' at line 1 0.000 sec
If I do :
SELECT * FROM mydb.groups;It works and if I do :
SELECT * FROM `groups`;It works too.
最满意答案
GROUPS是保留关键字(在8.0.2(保留)中添加了GROUPS(R)):
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-G
GROUPS is a reserved keywords (GROUPS (R) added in 8.0.2 (reserved)) :
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-G
更多推荐
发布评论