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 Results From Aggregate Values in A Select

Re: Top N Results From Aggregate Values in A Select

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: Thu, 8 Dec 2005 00:41:05 +0000 (UTC)
Message-ID: <dn7vf0$180$2@nntp.init7.net>


On 2005-12-07, Tim Marshall <TIMMY!@PurplePandaChasers.Moertherium> wrote:
> HI everyone, I think this should be easy - my reference book seems to be
> discussing using ranking functions to be able to obtain the top N
> results. I'm not sure if that applies here as I haven't done this in
> Oracle before. As an example, consider the following statement. It
> returns about 150+ rows. I would like the top 10 "Space owners" with
> the most requests:
>
> SELECT
> count(*) "Request",
> cn_Name "Space Owner"
> FROM
> tma.f_workorder, tma.f_clients
> WHERE
> wo_type_code IN ('1', 'A')
> wo_cn_fk = cn_pk(+)
> GROUP BY
> cn_name
>
> Thanks very much for any help on this!

Does the following link help?

http://www.adp-gmbh.ch/ora/sql/analytical/top_n.html

Rene

-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
Received on Wed Dec 07 2005 - 18:41:05 CST

Original text of this message

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