Viewing All Partitions in a Specified Table

Function

This statement is used to view all partitions in a specified table.

Syntax

1
2
SHOW PARTITIONS [db_name.]table_name
  [PARTITION partition_specs];

Keywords

Parameters

Table 1 Parameters

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.

Precautions

The table specified in this statement must exist and must be a partitioned table. Otherwise, an error is reported.

Example