110278 121212 2121212 1998bcd fadadada
112 212131 2121 2999dada dadada
.................................
我只想提取列数据如下:
1998
2999
请大拿赐教
4 个解决方案
#1
自己写个function吧,一劳永逸;
#2
取第三个空格后的4位字符:
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)+1,4) from dual;
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)+1,4) from dual;
#3
,instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)写错了,应该:
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1,3)+1,4) from dual;
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1,3)+1,4) from dual;
#4
非常感谢,我之前搜了关于substr和instr的用法,没整明白,看完你的写法后,明白了。非常感谢
#1
自己写个function吧,一劳永逸;
#2
取第三个空格后的4位字符:
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)+1,4) from dual;
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)+1,4) from dual;
#3
,instr('110278 121212 2121212 1998bcd fadadada',' ',1'3)写错了,应该:
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1,3)+1,4) from dual;
select substr('110278 121212 2121212 1998bcd fadadada',instr('110278 121212 2121212 1998bcd fadadada',' ',1,3)+1,4) from dual;
#4
非常感谢,我之前搜了关于substr和instr的用法,没整明白,看完你的写法后,明白了。非常感谢