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: Can you sort the connect by prior clase

Re: Can you sort the connect by prior clase

From: Steve Bach <sbach_at_nospamix.netcom.com>
Date: Tue, 02 Mar 1999 21:44:37 GMT
Message-ID: <36dc5a21.864844295@nntp.ix.netcom.com>


The only way to affect the order of the output is with indexes. For example, create a concatenated index using parentid and childid. You may have to add a hint to the select clause if the new index is not used. You can determine which index(es) is/are being used via the "explain plan" function.

Hope this helps.

Steve

On Mon, 01 Mar 1999 21:39:49 +0100, Anders Eriksson <anders_at_knowledgepartner.com> wrote:

>This is a multi-part message in MIME format.
>--------------F770935169C15C34C3F0EC93
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>Hello!
>
>I am using the connect by prior clause to list group-group and
>gruop-user relations. Unfortunately the output does not become that nice
>since the the result set is not ordered on each level. If you look in
>the documentation you find that the different classes should be ordered
>as:
>
>select
>from
>where
>start with
>connect by
>order by
>
>example:
>select rpad( ' ', 4*level+1 ) || parentId, rpad( ' ', 4*level+1 )
>childId
> from groupsAndUsers
> connect by parentId = prior childId
> start with parentId is null
> order by childId;
>
>But when you add the order by clause it will order the whole result set:
>That it not what I want I just want to keep the basic hierarchy produced
>by connect by and only add order to the different levels.
>
>I do appreciate all suggestions. I don't have a clue how to solve the
>problem.
>
>Regards
>Anders Eriksson
>
>
>
>
>
>--------------F770935169C15C34C3F0EC93
>Content-Type: text/x-vcard; charset=us-ascii;
> name="anders.vcf"
>Content-Transfer-Encoding: 7bit
>Content-Description: Card for Anders Eriksson
>Content-Disposition: attachment;
> filename="anders.vcf"
>
>begin:vcard
>n:Eriksson;Anders
>tel;work:+46 707 70 65 75
>x-mozilla-html:FALSE
>org:Knowledge Partner
>version:2.1
>email;internet:anders_at_knowledgepartner.com
>title:Consultant/Technical Trainer
>note:OCP DBA Oracle 7 & 8
>adr;quoted-printable:;;Po Box 6044=0D=0AAstronomiv 43;Jarfalla;;S-175 06;Sweden
>x-mozilla-cpt:;-1
>fn:Anders Eriksson
>end:vcard
>
>--------------F770935169C15C34C3F0EC93--
>
Received on Tue Mar 02 1999 - 15:44:37 CST

Original text of this message

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