RANGE COLUMNS partitioning is similar to RANGE partitioning, but enables you to define partitions using ranges based on multiple column values. In addition, you can define the ranges using columns of types other than integer types. RANGE COLUMNS partitioning differs significantly from RANGE partitioning in the following ways:
- RANGE COLUMNS does not accept expressions, only names of columns
- RANGE COLUMNS accepts a list of one or more columns
- RANGE COLUMNS partitioning columns are not restricted to integer columns; string, DATE and DATETIME columns can also be used as partitioning columns
Instead of using the to_days() or year() function, you can directly use the column hire_date in RANGE COLUMNS:
mysql> ALTER TABLE ...