1. 程式人生 > >oracle 逗號分隔欄位拆分,記錄下

oracle 逗號分隔欄位拆分,記錄下

拆分前資料:

拆分指令碼:

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;
拆分後的資料: