本文共 551 字,大约阅读时间需要 1 分钟。
like谓词可以用posstr标准函数替换,具体做法就是将a like '%b%' 替换为 posstr(a,'b')>0.
由于我在视图上like所以极慢,所以我用posstr快很多。但是like对索引还是很有效果的。
下面是oracle的函数
1.%a%方式:
select * from pub_yh_bm twhere instr(t.chr_bmdm,'2')>0等份于:select * from pub_yh_bm twhere t.chr_bmdm like '%2%'2.%a方式:
select * from pub_yh_bm twhere instr(t.chr_bmdm,'110101')=length(t.chr_bmdm)-length('110101')+1等份于:select * from pub_yh_bm twhere t.chr_bmdm like '%110101'3.a%方式:
select * from pub_yh_bm twhere instr(t.chr_bmdm,'11010101')=1等份于:select * from pub_yh_bm twhere t.chr_bmdm like '11010101%'转载地址:http://mbvcb.baihongyu.com/