该示例演示了从描述字段中提取想要的关键信息,下面对同一字段进行标的编号与期数信息的提取。
select distinct b.machdt || substr(lpad(trantm, 9, ‘0‘), 1, 6) trantm,
custac,
trim(translate(regexp_substr(remark, ‘((-))[A-Z0-9]+‘),
‘-]‘,
‘‘)) subjcd,
trim(translate(regexp_substr(remark, ‘(第)[A-Z0-9]+(期)‘),
‘第期‘,
‘‘)) qishu
from cbmain_user.my_table b
where machdt > ‘20190201‘
translate的使用介绍:
oracle translate() 详解
+
实例
regexp_substr的使用介绍:
Oracle中REGEXP_SUBSTR及其它支持正则表达式
原文:https://www.cnblogs.com/kevinlucky/p/11621326.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!