PL/SQL script to clean a table

From: Caroline <hilmarcher_at_yahoo.com>
Date: 24 Apr 2002 03:31:43 -0700
Message-ID: <8f934c98.0204240231.5457e004_at_posting.google.com>



HI all,
[Quoted] [Quoted] I have a table with so many entries every day so I want to clean it.

table name : service
table attributes : code, location, date

the goal is to delete each records where :

  1. I can find the same code AND location
  2. date > one month ago

BUT : I have to keep the last record with this code and location before one month.

example:

1)code=1 location=a date=20/04/02
2)code=1 location=a date=20/03/02
3)code=1 location=a date=21/03/02

*I keep the record 1) beacuse the date < one month
*I keep the 3) and I delete the 2) record because code and location
are the same, date > one month
and 3.date > 1.date

And I don't know how to do that ...

Many thanks

Caroline Received on Wed Apr 24 2002 - 12:31:43 CEST

Original text of this message