Oracle 行转多行
文章引用:
https://blog.csdn.net/jean852001/article/details/109338337
select * from (
select enbid, REGEXP_SUBSTR(v_list, '[^,]+', 1, lv) v_value
from (select 736021 as enbid, '5,51' as v_list from dual
union all
select 186168 as enbid, '53,49,50' as v_list from dual
union all
select 749409 as enbid, '7,68,51,11' as v_list from dual) a,
(SELECT LEVEL lv FROM dual CONNECT BY LEVEL < 32) b
WHERE b.lv <= 10 ) where v_value is not null;