You can use the DROP TABLE syntax to delete a specified table from the current database.
Applicable engines
The DROP TABLE syntax is applicable to LindormTable and LindormTSDB.
Syntax
drop_table_statement ::= DROP TABLE [ IF EXISTS ] table_identifier
Usage notes
Before you execute the DROP TABLE statement to delete a specified table from the current database, take note of the following items:
If the LindormTable version of your instance is in a range from 2.2.16 to 2.4.1, you must manually execute an
OFFLINE TABLE
statement to set the state of the table to offline before you execute theDROP TABLE
statement to delete the table. For more information about theOFFLINE TABLE
syntax, see OFFLINE TABLE.After a table is deleted by using the
DROP TABLE
syntax, the storage used to store the table is not immediately released. You can configure a TTL for the database to completely delete the data of a deleted table. For more information about how to configure a TTL for a database, see ALTER DATABASE.
Examples
Delete a table named sensor.
DROP TABLE IF EXISTS sensor;