content_image/847926.jpg content_image/847925.jpg
for more information about these, see Section 24.2.1, “RANGE Partitioning” , and Section 24.2.2, “LIST Partitioning” , respectively. 

## 24.2.3.1 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  partitions are based on comparisons between tuples  (lists of column values) rather than comparisons between scalar values. Placement of rows in RANGE COLUMNS  partitions is also based on comparisons between tuples; this is discussed further later in this section. 

• RANGE COLUMNS  partitioning columns are not restricted to integer columns; string, DATE  and DATETIME columns can also be used as partitioning columns. (See Section 24.2.3, “COLUMNS Partitioning” , for details.) 

The basic syntax for creating a table partitioned by RANGE COLUMNS  is shown here: 

CREATE TABLE table_name PARTITIONED BY RANGE COLUMNS( column_list ) ( PARTITION partition_name  VALUES LESS THAN ( value_list )[, PARTITION partition_name  VALUES LESS THAN ( value_list )][, ...] ) column_list : column_name [, column_name ][, ...] value_list : value [, value ][, ...] 

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

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

## Note 

Not all CREATE TABLE  options that can be used when creating partitioned tables are shown here. For complete information, see Section 13.1.20, “CREATE TABLE Statement” . 

In the syntax just shown, column_list  is a list of one or more columns (sometimes called a partitioning column list ), and value_list  is a list of values (that is, it is a partition definition value list ). A value_list  must be supplied for each partition definition, and each value_list  must have the same number of values as the column_list  has columns. Generally speaking, if you use N  columns in the COLUMNS  clause, then each VALUES LESS THAN  clause must also be supplied with a list of N  values. 

The elements in the partitioning column list and in the value list defining each partition must occur in the same order. In addition, each element in the value list must be of the same data type as the corresponding element in the column list. However, the order of the column names in the partitioning column list and the value lists does not have to be the same as the order of the table column definitions in the main part of the CREATE TABLE  statement. As with table partitioned by RANGE , you can use MAXVALUE  to represent a value such that any legal value inserted into a given column is always less than this value. Here is an example of a CREATE TABLE  statement that helps to illustrate all of these points: 

mysql> CREATE TABLE rcx ( -> a INT, -> b INT, 

