O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

RANGE COLUMNS partitioning

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required