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' Analysis

Re: Top 'N' Analysis

From: <fleeting_at_net1plus.com>
Date: Thu, 25 Sep 2003 20:14:46 -0400
Message-ID: <b517nv068bscibivokmdp0kh3face7osbd@4ax.com>

Thanks to all who helped - I truly appreciate it!

And to Richard ...anyone that mentions Bowie deserves extra credit!

Kevin

On Thu, 25 Sep 2003 13:06:33 GMT, "Richard Foote" <richard.foote_at_bigpond.com> wrote:

>
><fleeting_at_net1plus.com> wrote in message
>news:05u3nvcvrvq1rkr42e72ssvpmfnf20rmaf_at_4ax.com...
>> I'm studying to get my DBA in Oracle 9i. After I went through the 3
>> CD's sent to me, I took the first test and found a question that I
>> never saw on the CD's! It refered to Top 'N' Analysis.
>>
>> I tried going through the CD's again just to see if maybe I missed
>> something, but still cannot find the reference to Top 'N' analysis.
>>
>> Can someone give me a head's-up as to what this is? Even better - can
>> you tell me where on the three CD's I may have missed this?
>>
>> Thank you for your help - great group!
>>
>> Kevin
>
>Hi Kevin,
>
>Top (or Bottom) N Analysis is a neat method that allows one to relatively
>easily and efficiently determine the first or last "N" rows in an ordered
>returned row set. For example:
>
>SELECT *
>FROM (SELECT bowie_album, bowie_sales
> FROM bowie_stuff
> ORDER BY bowie_sales DESC)
>WHERE rownum < 11;
>
>The in-line view is "clever" enough to realize that only 10 rows are
>required (due to the outer WHERE condition) and so only stores to "top-n"
>rows as it ploughs through the data, resulting in a tiny sort at the end.
>
>To get the bottom-n analysis, you obvious sort the data in ascending order.
>
>Hope this helps
>
>Richard
>
Received on Thu Sep 25 2003 - 19:14:46 CDT

Original text of this message

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