Delete a column in BigQuery

In BigQuery, we can remove one or more columns from an existing table using the ALTER TABLE … DROP COLUMN statement. This operation modifies the table schema and does not require recreating the table.

SQL Syntax

ALTER TABLE table_name
DROP COLUMN [IF EXISTS] column_name [, ...];    

Arguments:

Example: Drop a single column from a table.

SQL

ALTER TABLE `ashishcoder.Coding_Dataset.clustered_table`
DROP COLUMN IF EXISTS total_amount;    

Dropping Multiple Columns at Once

We can drop more than one column in a single ALTER TABLE statement.

SQL

ALTER TABLE `ashishcoder.Coding_Dataset.clustered_table`
DROP COLUMN IF EXISTS discount,
DROP COLUMN IF EXISTS tax;