一、将一条记录复制成多条相同记录
select
code
from
(
select '001,002,003,004,005,' as code from dual
)
connect by level<=5;
二、实现将一串字符转换成行记录
select
regexp_substr(code,'[^,]+',1,level) code,level
from
(
select '001,002,003,004,005,' as code from dual
)
connect by level<=5
结果:
code level
001 1
002 2
003 3
004 4
005 5