Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> hierachical query.
Hello,
I do have a table which has an hierarchical structure. Example:
Child Parent ParentType ChildType 1 null 1 2 2 1 2 3 3 2 3 4 4 3 4 5 5 1 2 3 6 5 3 4 7 6 4 5 8 1 2 3 9 8 3 5 10 8 3 5...
Now i need a querry which give me records that list all the childs of childtype 5 whit they ancestor of type 3.
EG
ChildTp5 ParentTp3
4 2 7 5 9 8 10 8
I need to have this refference regardless the number of levels between the
ancestor and the specified child.
The maximum dept i can obtain of the moment is a difference of 2 levels. I
could do this with next querry.
select child, parent, prior parent
from ...
start with ...
connect by prior ......
But when there are more level i can't find out how to get the information that i need. I did search in the documentation how to list the root node in an hierarchical querry.
Kind regards
Rudy Van Eeckhout Received on Thu Sep 20 2001 - 01:41:01 CDT
![]() |
![]() |