Forum OpenACS Development: Re: Hierarchical query in Oracle - prvileges tree

Collapse
Posted by Michael Hinds on
Is it just the order that's bothering you? That's easily fixed:
select
  nvl(tree.tree_level,0) as tree_level,
  tree.privilege,
  p.privilege as child_privilege
from
  test_acs_privileges p,
  (select
     level as tree_level,
         privilege,
         child_privilege
   from
     test_acs_privilege_hierarchy
   connect by privilege = prior child_privilege
     start with privilege in ('one_top_level', 'another_top_level')
  ) tree
where
  tree.child_privilege(+) = p.privilege
order by tree_level,tree.privilege