没有拆分之前是:
拆分后是:
sql:
with p as(
select ID, HSIDS from in_wzcg_ys_mb //多个则使用,union 进行连接即可
)
select t1.ID, regexp_substr(t1.HSIDS, '[^,]+', 1, level) as hsid
from p t1
connect by t1.ID = prior t1.ID
and prior dbms_random.value is not null
and level <= length(t1.HSIDS) - length(regexp_replace(t1.HSIDS, ',', '')) + 1