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: Oracle Queries/Paging

Re: Oracle Queries/Paging

From: Dmitry E. Loginov <lde_at_mpsb.moris.ru>
Date: Mon, 18 Oct 1999 14:04:22 +0300
Message-ID: <380AFEB6.3C7520C3@mpsb.moris.ru>


In this example ORDER BY clause works _AFTER_ selecting by rownum, that made invalid sorting.

Igor Faershtein wrote:
>
> I'm sorry, If you need to order first you can try the next way
>
> select rownum , A.*
> from
> ( select rownum rn, id,code from komioil.prim3
> /*where clause*/
> group by code,id, rownum /* ordering by code first, id next and the last
> by rownum */
> /*having clause */ ) A
> /*****************/
> /* where clause*/
> group by rownum, a.RN,a.ID,a.CODE
> having rownum >=5 and rownum <8
>
> /*order clause */
>
> Igor
Received on Mon Oct 18 1999 - 06:04:22 CDT

Original text of this message

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