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 @ 2019-03-02 18:30  今夜有点儿凉  Views(5708)  Comments(0Edit  收藏  举报