Re: Archive Data
Posted by: Aram Mirzadeh
Date: September 12, 2016 03:22PM

How about:

LOCK TABLE `live`.`table` WRITE;

INSERT INTO `archive`.`table` SELECT * FROM `live`.`table` WHERE `date_column` > DATE_SUB(now(), INTERVAL 6 MONTH);

DELETE FROM `live`.`table` WHERE `date_column` > DATE_SUB(now(), INTERVAL 6 MONTH);

UNLOCK TABLE `live`.`table`;

Options: ReplyQuote


Subject
Written By
Posted
August 05, 2016 01:42AM
August 06, 2016 05:07PM
August 10, 2016 01:51AM
August 14, 2016 06:41PM
August 15, 2016 03:34AM
Re: Archive Data
September 12, 2016 03:22PM
September 14, 2016 07:43PM
August 17, 2016 07:44PM


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.