mybatis报错SQLException、syntax error、expect IDENTIFIER, actual IDENTIFIER pos
错误信息以下错误信息显示是语法错误,但是将sql语句放在mysql里面执行却依然能够执行,以下是错误代码:> Cause: java.sql.SQLException: sql injection violation, syntax error:> syntax error, error in :'ar u left join zzlc$user_car_file', expect&g
·
错误信息
以下错误信息显示是语法错误,但是将sql语句放在mysql里面执行却依然能够执行,以下是错误代码:
> Cause: java.sql.SQLException: sql injection violation, syntax error:
> syntax error, error in :'ar u left join zzlc$user_car_file ', expect
> IDENTIFIER, actual IDENTIFIER pos 45, line 1, column 46, token
> IDENTIFIER null : select u.*,f.uuid file1 from zzlc$user_car u left
> join zzlc$user_car_file ucf on u.id=ucf.user_car_id left join
> zzlc$file f on f.id=ucf.file_id where u.id=? ; uncategorized
> SQLException; SQL state [null];
解决方案
给表名加上单引号,即可解决。注意单引号是`而不是’。原因可能是表名中含有$ 字符所以要加上。
@Select("select * from zzlc$approve_attr where id in (#{idList})")
更多推荐
已为社区贡献3条内容
所有评论(0)