Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: begginer - select first X records
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