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: Al Chase <alchase_at_airmail.net>
Date: 1997/01/31
Message-ID: <32f23532.14123258@news.airmail.net>#1/1

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

Original text of this message

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