call Insert_Partition('2018-07-07','2019-01-01');
存储过程
BEGIN DECLARE nowdate date;DECLARE endtmp date;declare dt VARCHAR(256);declare partitionTemp VARCHAR(256);set nowdate = DATE_FORMAT(beginDate,'%Y%m%d');set endtmp = DATE_FORMAT(endDate,'%Y%m%d');WHILE nowdate
加分区:
ALTER TABLE kin_info ADD PARTITION (PARTITION p20180704 VALUES LESS THAN (TO_DAYS ('2018-07-04')));删除分区:ALTER TABLE kin_info DROP PARTITION p20180718;