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: pruning branches from a "connect by Prior" query

Re: pruning branches from a "connect by Prior" query

From: Dmitry Loginov <lde_at_mpsb.ru>
Date: Tue, 14 Feb 2006 15:14:31 +0300
Message-ID: <dsshj7$7hc$1@news.caravan.ru>


Just add " and type_code <> 'CD' " expression to the start with clause!

<mcoope29_at_csc.com> wrote in message
news:1139918622.602534.237600_at_g44g2000cwa.googlegroups.com...
>I am having trouble pruning branches from a "connect by Prior" query
<skip>
> so far so good, but I now want to exclude the branch where the
> Type_code ='RC'. Thus the query should exclude the first 5 rows above
> and return:
>
> 1 38 6 RK
> 1 38 17 RK
> 2 17 9 KM
> 2 17 8 KM
>
> So I changed my query to :
> select level || ' ' || lpad(' ',2*(level-1)) || to_char(Parent) || '
> '|| to_char(child) || ' ' ||(type_code) s
> from test_connect_by
> start with parent =38
> connect by prior child = parent and type_code <> 'CD' ;
>

<skip>

Dmitry Received on Tue Feb 14 2006 - 06:14:31 CST

Original text of this message

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