Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Big Problem !

Re: Oracle Big Problem !

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 13 Jan 2005 10:16:20 -0800
Message-ID: <115640180.00005e13.065@drn.newsguy.com>


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 Corporation
Received on Thu Jan 13 2005 - 12:16:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US