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

Home -> Community -> Usenet -> c.d.o.server -> Re: TOP N in Oracle

Re: TOP N in Oracle

From: Tom Dyess <tdyess_at_dysr.com>
Date: Thu, 3 Feb 2005 09:07:22 -0500
Message-ID: <waqMd.24074$t67.13655@bignews5.bellsouth.net>


"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.com 
Received on Thu Feb 03 2005 - 08:07:22 CST

Original text of this message

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