Re: Newbie SQL question (Top 10 values)

From: RAC <mudhens_at_cyberramp.net>
Date: 1996/01/15
Message-ID: <4dckc6$chl_at_newshost.cyberramp.net>#1/1


Rob Weeks <rweeks_at_kodak.com> wrote:

>How in the heck do I write a query that either returns the top 10% or
>top ten values of a specific field (sales information for instance)? In
>my MSAccess days, there was a Top 10 values wizard thingy to do the same
>type of thing. Many thanks in advance for any help that you can give me.
 

>rob weeks
>rweeks_at_kodak.com

You can get the top ten values by (1) sorting in descending order the field that you want to see and (2) adding an additional where clause stating "and rownum < 11" For example, you query might look like

select sales
from table_name
where rownum < 11
order by sales desc

Hope this helps. Received on Mon Jan 15 1996 - 00:00:00 CET

Original text of this message