Connect by [message #374114] |
Fri, 25 May 2001 08:00 |
David
Messages: 110 Registered: November 1998
|
Senior Member |
|
|
How can I traverse over a circular(!) table using CONNECT BY without getting the ORA-01436 ?
For example, if I have a table like this:
parent child
----- -----
1 2
2 1
2 3
3 2
4 5
5 4
how can I get a result like { 1 , 2 , 3 } if I'm starting with parent = 1 ?
|
|
|
Re: Connect by [message #374115 is a reply to message #374114] |
Fri, 25 May 2001 10:02 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
The connect by is only designed to handle hierarchical structures. As you have records pionting to each other (A -> B and B -> A) try including a where clause to filter out the duplicates i.e.
where Parent < Child ( > will work too)
|
|
|