[001016001*110725153134112]|办公室/海洋台|:|葛和平|2011-12-06^
1.要取得110725153134112的值:
select substr(ch_sign,12,15) bgszr from EVECTION_APPLY
2.如果110725153134112的值是动态的,长短不一:
select substr(ch_sign,instr(ch_sign,'*')+1,(instr(ch_sign,']')-instr(ch_sign,'*')-1)) from EVECTION_APPLY
select substr(substr(ch_sign,instr(ch_sign,'*')+1),0,instr(substr(ch_sign,instr(ch_sign,'*')+1),']')-1) from EVECTION_APPLY
这两个都可以要取得110725153134112的值
3.截取字符串长度length(qf_sign)
select substr(qf_sign, length(qf_sign) - 10, 10) qf_sign from ARCHIVES_OUT where OUT_ID = '1202220218462'
substr()截取函数
substr(DETAIL_TYPE,4,1)
instr(源字符串, 要查找的字符串, 从第几个字符开始, 要找到第几个匹配的序号)
返回指定一字符串在另一字符串中最先出现的位置。在字符串string1中,从start开始找string2,省略start时从string1头开始找。找不到时,函数值为0