17,377
社区成员
发帖
与我相关
我的任务
分享
with tab1 as (
select level id, nullif(level, 1) - 1 parent_id from dual connect by level < 6
)
select listagg(t1.id, '-') within group(order by level desc)
from tab1 t1
start with t1.id = &start_id
connect by prior t1.parent_id = t1.id
;