首页 > 代码库 > 字符串
字符串
截取字符串的函数:
select
‘12345sda‘,
decode(‘12345sda‘,‘MM SP‘,null,nvl(substr(‘12345sda‘,0,instr(‘12345sda‘,‘-‘,1)-1),‘12345sda‘)),
decode(‘12345sda‘,‘MM SP‘,‘12345sda‘,substr(‘12345sda‘, decode(instr(‘12345sda‘,‘-‘,1),0,null,instr(‘12345sda‘,‘-‘,1)) - length(‘12345sda‘))),
‘12345 - orgtest1‘,
decode(‘12345 - orgtest1‘,‘MM SP‘,null,nvl(substr(‘12345 - orgtest1‘,0,instr(‘12345 - orgtest1‘,‘-‘,1)-1),‘12345 - orgtest1‘)),
decode(‘12345 - orgtest1‘,‘MM SP‘,‘12345 - orgtest1‘,substr(‘12345 - orgtest1‘, decode(instr(‘12345 - orgtest1‘,‘-‘,1),0,null,instr(‘12345 - orgtest1‘,‘-‘,1)) - length(‘12345 - orgtest1‘))),
‘MM SP‘,
decode(‘MM SP‘,‘MM SP‘,null,nvl(substr(‘MM SP‘,0,instr(‘MM SP‘,‘-‘,1)-1),‘MM SP‘)),
decode(‘MM SP‘,‘MM SP‘,‘MM SP‘,substr(‘MM SP‘, decode(instr(‘MM SP‘,‘-‘,1),0,null,instr(‘MM SP‘,‘-‘,1)) - length(‘MM SP‘)))
from dual;
select
‘12345sda‘,
decode(‘12345sda‘,‘MM SP‘,null,nvl(substr(‘12345sda‘,0,instr(‘12345sda‘,‘-‘,1)-1),‘12345sda‘)),
decode(‘12345sda‘,‘MM SP‘,‘12345sda‘,substr(‘12345sda‘, decode(instr(‘12345sda‘,‘-‘,1),0,null,instr(‘12345sda‘,‘-‘,1)) - length(‘12345sda‘))),
‘12345 - orgtest1‘,
decode(‘12345 - orgtest1‘,‘MM SP‘,null,nvl(substr(‘12345 - orgtest1‘,0,instr(‘12345 - orgtest1‘,‘-‘,1)-1),‘12345 - orgtest1‘)),
decode(‘12345 - orgtest1‘,‘MM SP‘,‘12345 - orgtest1‘,substr(‘12345 - orgtest1‘, decode(instr(‘12345 - orgtest1‘,‘-‘,1),0,null,instr(‘12345 - orgtest1‘,‘-‘,1)) - length(‘12345 - orgtest1‘))),
‘MM SP‘,
decode(‘MM SP‘,‘MM SP‘,null,nvl(substr(‘MM SP‘,0,instr(‘MM SP‘,‘-‘,1)-1),‘MM SP‘)),
decode(‘MM SP‘,‘MM SP‘,‘MM SP‘,substr(‘MM SP‘, decode(instr(‘MM SP‘,‘-‘,1),0,null,instr(‘MM SP‘,‘-‘,1)) - length(‘MM SP‘)))
from dual;
字符串
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。