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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to count & put a limit to the output at the same time ??

Re: How to count & put a limit to the output at the same time ??

From: Örjan Lundberg <orjanlundberg_at_my-dejanews.com>
Date: Sat, 5 Jun 1999 23:36:22 +0200
Message-ID: <7jc5lb$3d7$1@news.luth.se>


select NAME, COUNT FROM (
select NAME, count(*) as COUNT from A
group by NAME
order by 2 desc)
where ROWNUM <6;

should do it.

Regards,

Örjan Received on Sat Jun 05 1999 - 16:36:22 CDT

Original text of this message

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