Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Hierarchy -- walk up as well as down?
In article <3560e1b0.32713289_at_news1.occa.home.net> JRStern, JRStern_at_primalsys.com writes:
>The start with / connect by prior works great, walking down the
>hierarchy. Is it possible to walk up a hierarchy -- given a node, to
>walk up and get all the parents? I mean, efficiently?
You do this by moving the "prior" keyword to the other column in your CONNECT BY. As for efficiency, that depends on your indexes... make sure that you have both parent and child columns indexed appropriately.
![]() |
![]() |