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

第一种 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

 

posted @ 2020-07-10 17:51  韦邦杠  阅读(2481)  评论(0编辑  收藏  举报