MySQL Forums
Forum List  »  General

Re: How To Delete Older Records In Chunks
Posted by: Shobhit Srivastava
Date: September 02, 2014 12:15AM

Hey Rick,

Thanks for your response!

The block that I am using is from the same Web Page that you have shared.
Unfortunately, the block is not executing.

----------I have taken and modified below block from your URL----------
@a = 0
LOOP
DELETE FROM tbl
WHERE id BETWEEN @a AND @a+999
AND ts < DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
SET @a = @a + 1000
sleep 1 -- be a nice guy
UNTIL end of table
-----------------------------------------------------------------------

Options: ReplyQuote


Subject
Written By
Posted
Re: How To Delete Older Records In Chunks
September 02, 2014 12:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.