Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Top N Results From Aggregate Values in A Select
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!
-- Tim http://www.ucs.mun.ca/~tmarshal/ ^o< /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake /^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - MeReceived on Wed Dec 07 2005 - 15:18:07 CST
![]() |
![]() |