ORACLE中Like与Instr模糊查询性能大比拼
instr(title,'手册')>0 相当于 title like '%手册%'
instr(title,'手册')=1 相当于 title like '手册%'
instr(title,'手册')=0 相当于 title not like '%手册%'
select id, name from users where instr('101914, 104703', id) > 0;
它等价于
select id, name from users where id = 101914 or id = 104703;
SELECT code, name, dept, occupation FROM staff WHERE instr(code, '001') > 0;
等同于
SELECT code, name, dept, occupation FROM staff WHERE code LIKE '%001%' ;
posted on 2014-05-12 21:32 Sunny_NUAA 阅读(362) 评论(0) 编辑 收藏 举报