How to Drop a Column in ClickHouse
To remove a column from a table in ClickHouse, use the ALTER TABLE statement in combination with DROP COLUMN.
This example deletes the column my_column of table my_table:
ALTER TABLE my_table DROP COLUMN my_column;Include the IF EXISTS clause if you don’t want the query to return an error in case my_colum doesn’t exist:
ALTER TABLE my_table DROP COLUMN IF EXISTS my_column;