函数介绍:
截取的函数:
substr(?,?);
substr(?,?,?);
获取目标字符出现的位置:
instr(? , ? , ? );
instr( ? , ? , ? , ? )
例:
字符串 "AAA-BBB" 截取"AAA" "BBB"
select substr('AAA-BBB',1,instr('AAA-BBB','-',-1)-1) 值 from dual;
select substr('AAA-BBB',instr('AAA-BBB','-',-1)+1) 值 from dual;