18.2.3 删除分区
MySQL中支持使用ALTER TABLE DROP PARTITION语句删除RANGE分区,删除分区时,也会将当前分区中的数据一同删除。
例如,以t_members_year数据表为例,向t_members_year数据表中插入测试数据。
mysql> INSERT INTO t_members_year
-> (id, first_name, last_name, join_date, first_login_date, group_code, group_id)
-> VALUES
-> (1, 'binghe', 'binghe', '2009-01-01', '2009-01-01', 10001, 1),
-> (2, 'jim', 'green', '2015-01-01', '2015-01-01', 10002, 1),
-> (3, 'tom', 'tom', '2027-01-01', '2027-01-01', 10003, 2),
-> (4, 'xiaoming', 'xiaoming', '2038-01-01', '2038-01-01', 10004, 2);
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0
数据插入成功,查看t_members_year数据表中的数据分布。