All Products
Search
Document Center

DROP TABLE

Last Updated: Jun 18, 2021

Description

You can execute the DROP TABLE statement to delete tables from an ApsaraDB for OceanBase database.

Syntax

DROP [TEMPORARY] {TABLE | TABLES} [IF EXISTS]
    table_name [,table_name]...
    [RESTRICT | CASCADE]

Parameters

Parameter

Description

table_name

The name of the table that you want to delete. To delete multiple tables at a time, separate the table names with commas (,).

IF EXISTS

If you add IF EXISTS to the statement and the table that you want to delete does not exist, the system does not return an error. If you do not add IF EXISTS to the statement and the table that you want to delete does not exist, the system returns an error.

TEMPORARY

Delete a temporary table.

RESTRICT | CASCADE

This parameter is required if you migrate data from other databases to ApsaraDB for OceanBase.

Examples

  • Delete table test.
DROP TABLE IF EXISTS test;