Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> query help wanted
Hi,
I need some help/suggestions for a query that will keep the 200 most current rows for each customer and delete the rest (older) ones.
Table contains 2 columns - custid, access_date
For each custid, keep the 1st 200 most current rows, rest to be deleted.
Can this be done with just sql (eg. subquery returning sorted/ordered rows after the 1st 200 current rows) or we need to write this in Pl/sql with loop count for 200 and getting :access_date (and delete based on this date)?
Thanks
/sandeep
Received on Tue Jul 08 1997 - 00:00:00 CDT
![]() |
![]() |