如:合同编号:SHSZQ2100030CGN00,订单编号:POP点 WMZ2021012882179422,线路:WMZ2021012782073199
拆分成 SHSZQ2100030CGN00
WMZ2021012882179422
WMZ2021012782073199
写个存储过程处理吧,按逗号分隔一下。
您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632
with tab1 as (
select 1 id, 'asd8753959\;addw123123213' a from dual
union all select 2, 'WMX8753959, 编号:/addw-123123213 WAA2323131323' from dual
)
, tab2 as(
select t1.*,
regexp_replace(regexp_replace(t1.a, '[^a-zA-Z0-9\-]|\\', ';'), ';+', ';') b
from tab1 t1
)
select t1.*,
regexp_substr(t1.b, '[a-zA-Z0-9\-]+', 1, level)
from tab2 t1
connect by prior id = id
and level <= regexp_count(t1.b, ';') + 1
and prior sys_guid() is not null
;