Delete date

From: <muhammaddzulkarnain_at_gmail.com>
Date: Thu, 23 Oct 2008 19:47:55 -0700 (PDT)
Message-ID: <749179ac-e69d-4c2c-bcff-9a1dc87f580a@m36g2000hse.googlegroups.com>


hello everyone,

Can someone help me how to create sql statements to delete the table records and retain only 3 months of data. Concept should be like this:

Delete all (TABLE_NAME) table records where the statistics_date month is < current month – 3.

i tried this but its not working:

delete from gen_api_performance_daily
 where statistics_date < add_months(sysdate,-3);

and also how to create sql statements to delete the table records and retain only 1 year of data.
And concept should be like this:

Delete all (TABLE_NAME) table records where the statistics_year is = previous year – 1.

I have no idea about it.. Received on Thu Oct 23 2008 - 21:47:55 CDT

Original text of this message