java PageHelper 分页插件出现 Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate c...

it2022-05-05  137

情景:

Mapper.xml定义连表查询,如果sql的字段名中有sql关键字,会导致PageHelper插件出现 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'Id' 这样的错误。

将具有关键字性质的字段名前后加入 ` 符号即可,例如 a.`Id`,a.`Vin`

转载于:https://www.cnblogs.com/thirties/p/7868313.html


最新回复(0)