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 -> query help wanted

query help wanted

From: Sandeep Deshmukh <deshmukh_at_buymedia.com>
Date: 1997/07/08
Message-ID: <5puf9k$b4i@news.informix.com>#1/1

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

Original text of this message

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