forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
3.6 KiB
3.6 KiB
Deleting a Column
Function
The ALTER TABLE ... DROP COLUMN command is used to delete a column.
Syntax
ALTER TABLE tableName DROP COLUMN|COLUMNS cols
Parameter Description
Parameter |
Description |
---|---|
tableName |
Table name. |
cols |
Columns to be deleted. You can specify multiple columns. |
Example
ALTER TABLE table1 DROP COLUMN a.b.c ALTER TABLE table1 DROP COLUMNS a.b.c, x, y
a.b.c indicates the full path of a nested column. For details about the nested column rules, see Adding a Column.
Response
You can run the DESCRIBE command to check which column is deleted.
Parent topic: SparkSQL Schema Evolution and Syntax Description