Search code examples
mysqlpartitioningdatabase-partitioning

Is it possible to write a code for DROP the first partition without specifying the name?


The pseudocode would be something like the following:

ALTER TABLE sql_store.sale_mast13 DROP PARTITION FIRS_VALUE(PARTITIONS)

Solution

  • No. But you can get the name from information_schema.PARTITIONS. See GatherPartitionInfo() in http://mysql.rjweb.org/demo_part_maint.pl.txt . For more on partitioning, see the parent page: http://mysql.rjweb.org/doc.php/partitionmaint