.drop table 和 .drop tables.drop table and .drop tables

从数据库中删除一个或多个表。Removes a table or multiple tables from the database.

需要表管理员权限Requires table admin permission.


.drop table 命令仅软删除数据。The .drop table command only soft deletes the data. 也就是说,无法查询数据,但仍可从持久存储中恢复。That is, data can't be queried, but is still recoverable from persistent storage. 根据在将数据引入到表中时会生效的保留策略中的 recoverability 属性来硬删除基础存储项目。The underlying storage artifacts are hard-deleted according to the recoverability property in the retention policy that was in effect at the time the data was ingested into the table.


.drop table TableName [ifexists].drop table TableName [ifexists]

.drop tables (TableName1, TableName2,..) [ifexists].drop tables (TableName1, TableName2,..) [ifexists]


如果指定 ifexists,那当存在不存在的表时,命令不会失败。If ifexists is specified, the command won't fail if there is a non-existent table.


.drop table CustomersTable ifexists
.drop tables (ProductsTable, ContactsTable, PricesTable) ifexists


此命令返回数据库中剩余表的列表。This command returns a list of the remaining tables in the database.

输出参数Output parameter 类型Type 说明Description
TableNameTableName 字符串String 表的名称。The name of the table.
DatabaseNameDatabaseName StringString 表所属的数据库。The database that the table belongs to.