Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your My

转自:https://blog.csdn.net/haha_66666/article/details/78444457
Query : select * from order LIMIT 0, 1000
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 ‘order LIMIT 0, 1000’ at line 1

今天在查询数据的时候遇到这个错误,特别的郁闷,感觉自己写的sql语句没有问题啊,但就是提示我的sql语法错误,后来终于找到了原因

该错误一般出现在表名或字段名设计的过程中出现了mysql关键字导致的。

如果你用了mysql中的关键字做字段,当你查询的时候可以用 `把 order 来括起来

这个 `并不是单引号,而是数字那一行键的最左边的那个键,注意要在在英文状态下输入,用它把关键字括起来就可以解决这个问题。

猜你喜欢

转载自blog.csdn.net/u011732358/article/details/83584207