I’m looking for the function that will take rows older then X days and put it in archive table…
Was thinking to make function so it will be easer to execute… something like
CREATE TABLE archive_NUMBER_OF_WEEK (...);
INSERT INTO archive_NUMBER_OF_WEEK SELECT * FROM content WHERE DATE < X days;
DELETE * FROM content WHERE DATE < X days
Will post if I manage to write it by myself 🙂
Ok, I finality wrote it 🙂
It took me a while but here it is:
Feel free to feedback or edit it for your own use 🙂