Given the following model:
create table child_parent (
child number(3),
parent number(3)
);
Given the following data:
insert into child_parent values(2,1);
insert into child_parent values(3,1);
insert into child_parent values(4,2);
insert into child_parent values(5,2);
insert into child_parent values(6,3);
results in the following tree:
1
/ \
2 3
/ \ \
4 5 6
Now i can find the parents of 5 like this:
SELECT parent FROM child_parent START WITH child = 5
CONNECT BY NOCYCLE PRIOR parent = child;
But how can I get all the nodes (1,2,3,4,5,6) starting from 5?