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: Order of selected rows.

Re: Order of selected rows.

From: Kai Horstmann <horst_at_werum.de>
Date: Wed, 27 Jan 1999 11:05:10 +0100
Message-ID: <36AEE4D6.56F1EA6C@werum.de>


Erika Grondzakova schrieb:
>
> Could I rely on that when I run several times the SELECT statement of
> the HIERARCHICAL query, I will receive the same order of the selected
> rows?
> Especially I'm interested in the same order of the rows on the same
> level.
>
> Example :
>
> SELECT lpad(' ',2*(LEVEL-1))||name
> FROM region
> START WITH name= 'IR1'
> CONNECT BY PRIOR name=parent;
>

Try :

select * from

   ( SELECT lpad(' ',2*(LEVEL-1))||name as my_logical_column     FROM region

     START WITH name= 'IR1'
     CONNECT BY PRIOR name=parent ) a

   order by a.my_logical_column;

The result of the complete subquery is sorted in a second run.

Hpe that helps
Kai Received on Wed Jan 27 1999 - 04:05:10 CST

Original text of this message

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