日期:2014-05-17 浏览次数:21132 次
create table phoneno ( pno varchar2(20) ); insert into phoneno select '13766666021' from dual union select '13760666601' from dual union select '13766606660' from dual ; commit; select pno, substr(pno,instr(pno,'6666',1)), substr(substr(pno,instr(pno,'6666',1)),1,5), case when substr(substr(substr(pno,instr(pno,'6666',1)),1,5),1,4) = '6666' and substr(substr(substr(pno,instr(pno,'6666',1)),1,5),5,1) <> '6' then 'YES' else 'NO' end from phoneno;