Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Can you sort the connect by prior clase
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
![]() |
![]() |