Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Specifying the maximum number of rows retrieved from a query?

Re: Specifying the maximum number of rows retrieved from a query?

From: Pauli Salmu <pauli.salmu_at_pp.kolumbus.fi>
Date: 1997/02/01
Message-ID: <32F28ED3.232B@pp.kolumbus.fi>#1/1

Al Chase wrote:
> SELECT A.COLX FROM DATABASE.TABLENAME A
> WHERE ROWNUM < 3;
> ORDER BY A.DATE DESC;
>
> This worked correctly on several tables I hve which contain date
> fields. If you use 'order by' you will get the first 2 articles rather
> than the last two. DESCending does the trick

Are you quite sure? I seem to remember that rownum is evaluated before the results are sorted, in which case that wouldn't work. Received on Sat Feb 01 1997 - 00:00:00 CST

Original text of this message

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