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: Michael Ringbo <mri_at_dde-nospam.dk>
Date: Tue, 02 Mar 1999 11:34:23 +0100
Message-ID: <36DBBEAF.FE715BED@dde-nospam.dk>


Hi,

Maybe you could use the systemgenerated attribute LEVEL, which is applied to your connect by query by the kernel...

Try it out.

Regards,

Michael Ringbo

Anders Eriksson wrote:

> 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
>
> ------------------------------------------------------------------------
>
> Anders Eriksson <anders_at_knowledgepartner.com>
> Consultant/Technical Trainer
> Knowledge Partner
>
> Anders Eriksson
> Consultant/Technical Trainer <anders_at_knowledgepartner.com>
> Knowledge Partner
> Po Box 6044 Astronomiv 43;Jarfalla;;S-175 06;Sweden Work: +46 707 70 65 75
> Netscape Conference Address
> OCP DBA Oracle 7 & 8
> Additional Information:
> Last Name Eriksson
> First Name Anders
> Version 2.1
Received on Tue Mar 02 1999 - 04:34:23 CST

Original text of this message

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