您的位置:首页 > 数据库 > MySQL

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio

2017-05-17 19:09 736 查看
偶遇一朋友的一个bug,这个朋友在设计数据库的时候将表名设置成了一个关键字“group”,在后期的编程中遇到了这个问题。

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'group limit 0,5' at line 1


报错代码:

String sql = "select * from group limit ?,?";

解决措施:1` 更改表名;

                  2` 需要把 group 用撇号`括起来,就是键盘上数据1左边的那个键.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐