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

Home -> Community -> Usenet -> c.d.o.tools -> Re: begginer - select first X records

Re: begginer - select first X records

From: Honza Pazdziora <adelton_at_fi.muni.cz>
Date: Sun, 4 Feb 2001 15:25:37 GMT
Message-ID: <G88o6p.38J@news.muni.cz>

On Sat, 3 Feb 2001 23:07:57 +0100, Jan Elbæk <jael_at_worldonline.dk> wrote:
>
> something like this will do the trick :-)
>
> select * from files WHERE ROWNUM = X order by f_date desc
>
> where X is the actual number of records you want as result of your query...

No. It will return no records unless X is 1, and even if you use rownum <= X, you will get any X records, sorted, not the first X records, sorted. Try it.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, DBD::XBase.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------
Received on Sun Feb 04 2001 - 09:25:37 CST

Original text of this message

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