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

Home -> Community -> Usenet -> c.d.o.server -> Re: connect by

Re: connect by

From: Richard Senior <richard_at_r-senior.demon.co.uk>
Date: 28 Sep 2000 08:08:52 GMT
Message-ID: <8quuak$qr0$1@gate.local>

In article <8qtht5$evs$1_at_nnrp1.deja.com>,

        redrobin723_at_hotmail.com writes:

> I need to select ONLY the top most parent id from a table which
> includes parent/child ids.
>
> I'm using connect by, but can only seem to retrieve the entire list of
> relationships, not just the top node.

The root node/nodes of a tree constructed in this way is/are typically identified by a null in the parent ID column:

select * from t where parent_id is null;

-- 
Regards,

Richard
Received on Thu Sep 28 2000 - 03:08:52 CDT

Original text of this message

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