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

Can you sort the connect by prior clase

From: Anders Eriksson <anders_at_knowledgepartner.com>
Date: Mon, 01 Mar 1999 21:39:49 +0100
Message-ID: <36DAFB15.9C4A809C@knowledgepartner.com>


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


Received on Mon Mar 01 1999 - 14:39:49 CST

Original text of this message

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