oracle 逗号分隔字段拆分,记录下

原稿:https://blog.csdn.net/java_hq/article/details/77503307

拆分前数据:

拆分脚本:

select or_pid,
       regexp_substr(or_rule_id, '[^,]+', 1, level) or_rule_id
  from x_265_gd_644746
connect by level <= regexp_count(or_rule_id, ',') + 1
       and or_pid = prior or_pid
       and prior dbms_random.value is not null;

拆分后的数据:

 

你可能感兴趣的:(数据库)