DROP COLUMN
DROP COLUMN
can be used to remove columns from a table.
Permissions
The role must have the DDL
permission at the database or table level.
Syntax
alter_table_drop_column_statement ::=
ALTER TABLE [schema_name.]table_name DROP COLUMN column_name
;
table_name ::= identifier
schema_name ::= identifier
column_name ::= identifier
Parameters
Parameter |
Description |
---|---|
|
The schema name for the table. Defaults to |
|
The table name to apply the change to. |
|
The column to remove. |
Examples
Removing a column
-- Remove the 'weight' column
ALTER TABLE users DROP COLUMN weight;
Removing a column with a quoted identifier name
ALTER TABLE users DROP COLUMN "Weight in kilograms";