mybatis使用concat,报错:nested exception is java.sql.SQLSyntaxErrorException: ORA-00909: 参数个数无效

concat一次连接两个字符:例子如下:

select * from birthday where name like concat(concat('%',#{name}),'%')

 

如果直接写concat('%', #{name}, '%'),会报错!

### The error occurred while setting parameters
### SQL: SELECT count(0) FROM birthday WHERE name LIKE concat('%', ?, '%')
### Cause: java.sql.SQLSyntaxErrorException: ORA-00909: 参数个数无效

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00909: 参数个数无效

 

你可能感兴趣的:(MyBatis)