content_image/856118.jpg content_image/856107.jpg
PARTITION BY RANGE COLUMNS (lname) ( PARTITION p0 VALUES LESS THAN (’g’), PARTITION p1 VALUES LESS THAN (’m’), PARTITION p2 VALUES LESS THAN (’t’), PARTITION p3 VALUES LESS THAN (MAXVALUE) ); 

Alternatively, you could cause the employees  table as created previously to be partitioned using this scheme by executing the following ALTER TABLE  statement: 

ALTER TABLE employees PARTITION BY RANGE COLUMNS (lname) ( PARTITION p0 VALUES LESS THAN (’g’), PARTITION p1 VALUES LESS THAN (’m’), PARTITION p2 VALUES LESS THAN (’t’), PARTITION p3 VALUES LESS THAN (MAXVALUE) ); 

<img src='content_image/856118.jpg'>

## Note 

Because different character sets and collations have different sort orders, the character sets and collations in use may effect which partition of a table partitioned by RANGE COLUMNS  a given row is stored in when using string columns as partitioning columns. In addition, changing the character set or collation for a given database, table, or column after such a table is created may cause changes in how rows are distributed. For example, when using a case-sensitive collation, ’and’ sorts before ’Andersen’ , but when using a collation that is case-insensitive, the reverse is true. 

For information about how MySQL handles character sets and collations, see Chapter 10, Character Sets, Collations, Unicode . 

Similarly, you can cause the employees  table to be partitioned in such a way that each row is stored in one of several partitions based on the decade in which the corresponding employee was hired using the ALTER TABLE  statement shown here: 

ALTER TABLE employees PARTITION BY RANGE COLUMNS (hired) ( PARTITION p0 VALUES LESS THAN (’1970-01-01’), PARTITION p1 VALUES LESS THAN (’1980-01-01’), PARTITION p2 VALUES LESS THAN (’1990-01-01’), PARTITION p3 VALUES LESS THAN (’2000-01-01’), PARTITION p4 VALUES LESS THAN (’2010-01-01’), PARTITION p5 VALUES LESS THAN (MAXVALUE) ); 

See Section 13.1.20, “CREATE TABLE Statement” , for additional information about PARTITION BY RANGE COLUMNS  syntax. 

## 24.2.3.2 LIST COLUMNS partitioning 

MySQL 8.0 provides support for LIST COLUMNS  partitioning. This is a variant of LIST  partitioning that enables the use of multiple columns as partition keys, and for columns of data types other than integer types to be used as partitioning columns; you can use string types, DATE , and DATETIME  columns. (For more information about permitted data types for COLUMNS  partitioning columns, see Section 24.2.3, “COLUMNS Partitioning” .) 

Suppose that you have a business that has customers in 12 cities which, for sales and marketing purposes, you organize into 4 regions of 3 cities each as shown in the following table: 

<img src='content_image/856107.jpg'>

