码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2020-07-10 19:22:10      阅读:83      评论:0      收藏:0      [点我收藏+]

标签:class   tis   ||   table   模糊   cat   oracle   ike   mybatis   

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

 

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

标签:class   tis   ||   table   模糊   cat   oracle   ike   mybatis   

原文地址:https://www.cnblogs.com/weibanggang/p/13280527.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!