Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL Question: Return top 5
I have the following SQL statement that works great: select first_name|| ' ' || last_name fullname, count(*) from incidents GROUP BY first_name|| ' ' || last_name ORDER BY 2 DESC;
which returns
Fullname Count Person X 25 Person Y 12 Person Z 6 Person AA 5 Person BB 2
etc... the problme is that this query will return ALL my names in the table and their respective counts... how could I get it to display just the top 5 names. It's probably basic, but I could not find any documentation on how to do it.
Thanks again - and for those who replied on my last question, THANK YOU!
Sean Received on Wed Aug 26 1998 - 10:17:50 CDT
![]() |
![]() |