from (select ID,
NAME,
PASSWORD,
AGE,
COMPANY,
MOBILE,
BIRTHDATE,
rownum rn
from test_person));
-- 层级关系
select * from t_pour_trace t start with code = 'a01' connect by prior code = father_node;
select * from T_ANALYSE_SERVICE t start with father_node = 'a' connect by prior code = father_node;
-- level 伪列
select level,t.* from t_pour_trace t start with code = 'a01' connect by prior code = father_node order by level;
select level,t.* from T_ANALYSE_SERVICE t start with father_node = 'a' connect by prior code = father_node order by level;
-- 格式化层次化
select level,lpad(' ',4*level-1)||description from T_ANALYSE_SERVICE t start with father_node = 'a' connect by prior code = father_node ;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-769556/
,如需转载,请注明出处,否则将追究法律责任。