Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL Question
sales table with the following columns:
ord_id, sales_rep_id, total...
I can find the total sale amount for each sales rep and ordered by total sale amount by using the following sql code:
select sales_rep_id, sum(total)
from sales
group by sales_rep_id
order by sum(total_ desc
but how to find the top 3 sales reps? I know rownum doesn't help here.
Thanks a lot!
cy Received on Thu Sep 25 1997 - 00:00:00 CDT
![]() |
![]() |