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_at_mpsb.moris.ru>


[Quoted] 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 - 13:04:22 CEST

Original text of this message