Hierarchy Query
810903Nov 5 2010 — edited Nov 5 2010Hi Everyone,
I have a small requirement regarding hierarchy query which goes as below....
I have a table RELATION which has a child - parent relation.
create table relation
( parent number,
child number primary key
);
And the data will be like.
Parent Child
A B
A c
B D
B E
D F
C G
Now if i start from A i need the full path from A to its sons(and son of sons) all the possible path. can any one please help
me in writing a query which can give as the below output.
For A the output shoud be two rows as below:
A->B->D->F
A->B->E
For B as a parent it should be:
B->D->F
B->E
Please reply
Thanks in advance,
Sartaj