Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL - Select top 20 records
I am converting a Foxpro report to Oracle and I need to
figure out how to do the following:
In Foxpro:
Select Top 20 membno, sum(paid_amt) as paidamt
group by membno
order by paidamt desc
Returns an ordered list of the 20 members who had the largest paid claims amount.
How do I do this in Oracle?
I have tried using ROWNUM but this doesn't work and I can't use ORDER BY in subqueries.
I have 20-30K members and can't return them all.
Thanks for any help,
Phil Received on Fri Mar 12 1999 - 10:10:28 CST
![]() |
![]() |