昨天做一个功能,新建了一个数据表,然后在执行增加功能的时候后台报错:java.sql.BatchUpdateException: 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 'maxValue, flag, id) values ('PI', 'PI_YC_1_acPower', 8, 18, 1, 199, 0, 1)' at line 1
然后上网反复查了好长时间,有的网友说是表字段是‘关键字’所以错误,之后我对比了一下网上一些给的MySQL关键字表,并没有maxValue关键字,最后我把maxValue改成了maxVal,执行成功了。
MySQL官网关键字地址: http://dev.mysql.com/doc/refman/5.7/en/keywords.html