All Products
Search
Document Center

PolarDB:DROP PARTITION

Last Updated:Jan 11, 2024

This topic describes how to delete partitions and subpartitions and the data stored in these partitions and subpartitions.

Syntax

The ALTER TABLE…DROP PARTITION statement is used to delete partitions and subpartitions and the data stored in these partitions and subpartitions.
ALTER TABLE table_name DROP PARTITION partition_names;
Note This statement cannot delete only a subpartition or delete a hash or key partition.

Parameters

ParameterDescription
table_nameThe name (optionally schema-qualified) of the partitioned table.
partition_namesThe name of the partition.

Examples

Delete the p_2014 partition in the sales_range_range partitioned table:
ALTER TABLE sales_range_range DROP PARTITION p_2014;