instr()函数的使用

功能:

在Oracle/PLSQL中,instr函数返回要截取的字符串在源字符串中的位置

参数:

instr(resString,desString,iPosition,ePosition)

resString:源字符串; desString:要在resString字符串中搜索的字符串

示例:

select * from tqmtc50 where certi_bill_no ='CKD-1212205244' and instr('G2100022L,G2100086L,Z2100016L', sample_lot_no) >0 ORDER BY sample_lot_no;

等价于

select * from tqmtc50 where certi_bill_no ='CKD-1212205244' and sample_lot_no in ('G2100022L','G2100086L','Z2100016L')  ORDER BY sample_lot_no;

posted @ 2013-04-26 15:50  第九剑  阅读(239)  评论(0)    收藏  举报