connect by prior by reverse
990971Feb 13 2013 — edited Feb 13 2013I have a tree like this
------[1]------
| | |
[2] [3] [4]
| | |
[6] [7] [9]
|
[8]
So I made a select:
SELECT id, id_parent
FROM TB_FLUXO_ELEMENTO
START WITH id = 7
CONNECT BY PRIOR id_parent = id;
I'm expecting this selected rows:
ID ID_PARENT
----------------- ---------------------
7 3
3 1
1 -1
BUT! Its returns lots of duplicated rows and childs 2 and 4.
Any ideas to get only the path I choose (start with = X) and run through the tree by reverse?