CREATE TABLE sales (
order_date DATETIME NOT NULL
) ENGINE=InnoDB PARTITION BY RANGE(YEAR(order_date)) (
PARTITION p_2010 VALUES LESS THAN (2010),
PARTITION p_2011 VALUES LESS THAN (2011),
PARTITION p_2012 VALUES LESS THAN (2012),
PARTITION p_catchall VALUES LESS THAN MAXVALUE );
insert into sales values ('2000-01-01'),('2001-01-01'),('2010-01-01'),('2011-01-01'),('2012-01-01'),('2013-01-01');