Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Last 100 rows
In article <8e2biq$bsj$1_at_newsg3.svr.pol.co.uk>,
"Jim Harrison" <jim_at_colway.freeserve.co.uk> wrote:
> How about:
> select *
> from huge_tab
> where rownum <= 100
> order by order_col DESC;
>
This is not correct. The rownum is applied to the first 100 rows
retrieved and these are what are sorted. This means your result set is
not guarenteed to hold the largest value for order_col since it may be
located at a rownum >= 100.
-- Mark D. Powell -- The only advice that counts is the advice that you follow so follow your own advice -- Sent via Deja.com http://www.deja.com/ Before you buy.Received on Tue Apr 25 2000 - 00:00:00 CDT