Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Specifying the maximum number of rows retrieved from a query?
On Wed, 29 Jan 1997 19:26:51 -0800, Judy Lam <jlam_at_islco.com> wrote:
With due respect to the other suggestions, the simplest script would be
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
Al
>Is there a way specify the number of rows retrieved from a query?
>
>I have a table that stores article information. I want to retrieve the
>two latest articles.
Received on Fri Jan 31 1997 - 00:00:00 CST
![]() |
![]() |