Код:
SELECT lpad(' ', 3*level)||tree||' '||name "-"
FROM (select substr(tree,1,instr(tree,'.',-1,2)) "ptree", tree, name from supermag.sacardclass where tree!='#' order by id)
START WITH "ptree" is null
CONNECT BY PRIOR tree="ptree"
ORDER SIBLINGS BY name;
Код:
SELECT lpad(' ', 3*level)||tree||' '||name "-"
from (select tree,
name,
regexp_replace(tree, '(.*?)\d+\.$', '\1') col1_parent
from supermag.sacardclass)
start with col1_parent is null
connect by col1_parent = prior tree
order siblings by name;
пользуйтесь...