mybatis+oracle实现简单的模糊查询

时间:2020-07-10 19:22:10   收藏:0   阅读:83

第一种 concat

select * from cat_table where cat_name like concat(#{catName},‘%‘)      --单个百分号
select * from cat_table where cat_name like concat(concat(‘%‘,#{catName}),‘%‘)    --前后百分号

第二种 ||

select * from cat_table where cat_name like ‘%‘ || #{catName} || ‘%‘ 

 第三种 instr

select * from cat_table where instr(#{catName},‘helloworld‘)>0

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!