Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: TOP N in Oracle
"Cris Carampa" <cris119_at_operamail.com> wrote in message
news:420217a4$0$6304$5fc30a8_at_news.tiscali.it...
> Jining Han wrote:
>
>> where rownum<=10
>> order by ... desc
>
> You mean that, I hope:
>
> select
> cols
> from
> (select * from tab order by ordering_cols) ordered_query
> where
> rownum <= 10
> ;
>
> Kind regards,
>
> --
> "For every developer that thinks he can create something that is
> non-database specific ... there are two people being paid by the
> hour to clean up the mess later" (Daniel A. Morgan)
Yes, to keep the order, you must nest the original ordered query.
-- Tom Dyess OraclePower.comReceived on Thu Feb 03 2005 - 08:07:22 CST