Oracle数据库下用concat函数模糊查询之参数个数无效
一直报错参数个数无效,模糊查询的sql语句还是concat('%','s','%')这样写的但实际上oracle中不支持concat的三个参数的拼接,需要更正为select * from SYS_MENU where url like concat(concat('%',#{roleName}),'%')或者使用select * from SYS_MENU where urllike'%' ||#
·
一直报错参数个数无效,模糊查询的sql语句还是concat('%','s','%')这样写的
但实际上oracle中不支持concat的三个参数的拼接,需要更正为
select * from SYS_MENU where url like concat(concat('%',#{roleName}),'%')
或者使用
select * from SYS_MENU where url like '%' || #{roleName} || '%';
更多推荐


所有评论(0)