|
SELECT MAX(SYS_CONNECT_BY_PATH (bbsid, '^')) as bbb
FROM (SELECT
(select depth from tb_bi_tree where bbsid='board200') as uuu,bbsid, ROWNUM rn
FROM tb_bi_tree
START WITH bbsid = 'board200'
CONNECT BY PRIOR upper_bbsid=bbsid
)
START WITH rn = uuu - 2
CONNECT BY rn = PRIOR rn - 1 ;
=======================================
BBB
----------------------------
^board151^board197^board200
|