This statement is used to view all partitions in a specified table.
1 2 | SHOW PARTITIONS [db_name.]table_name [PARTITION partition_specs]; |
Parameter |
Description |
---|---|
db_name |
Database name that contains letters, digits, and underscores (_). It cannot contain only digits and cannot start with an underscore (_). |
table_name |
Table name of a database that contains letters, digits, and underscores (_). It cannot contain only digits and cannot start with an underscore (_). The matching rule is ^(?!_)(?![0-9]+$)[A-Za-z0-9_$]*$. If special characters are required, use single quotation marks ('') to enclose them. |
partition_specs |
Partition information, in the format of "key=value", where key indicates the partition field and value indicates the partition value. If a partition field contains multiple fields, the system displays all partition information that matches the partition field. |
The table specified in this statement must exist and must be a partitioned table. Otherwise, an error is reported.
1 | SHOW PARTITIONS student; |
1 | SHOW PARTITIONS student PARTITION(dt='2010-10-10') |