Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Big Problem !
In article <5e5f6ab0ff220ed326411d4835e524b5.84112_at_mygate.mailgate.org>, Joshua
Lool says...
>
>Hi,
>I'm haveing some problem with Oracle Sql.
>
>I'm in this situation :
>
>---Table FATHERSON---
>
>FATHER ---- SON
>A B
>A C
>C D
>C E
>E F
>G I
>G C
>
>
>I need to return, for example, only the sons starting from C :
>
>C D
>C E
>E F
>
>
>I use Oracle 9 and I know that there's the function CONNECT BY PRIOR
>but it doesn't work in my case because I undestood it needs a primary
>unique key and in my case it's impossible.
>
>Can someone help me ?
>
>
you need no keys
select *
from t
start with father = 'C'
connect by prior son = father;
-- Thomas Kyte Oracle Public Sector http://asktom.oracle.com/ opinions are my own and may not reflect those of Oracle CorporationReceived on Thu Jan 13 2005 - 12:16:20 CST
![]() |
![]() |