Skip to Main Content
Header Position Sticky Install Database Objects

How to represent Trees

How to represent Trees

Example

SELECT case when connect_by_isleaf = 1 then 0
            when level = 1 then 1
       else -1
       end as status,
       level,
       c as title,
       null as icon,
       c as value,
       null as tooltip,
       null as link
    FROM t
    start with p IS NULL
    CONNECT BY NOCYCLE PRIOR c = p
;