BigQuery · Query syntax
BigQuery SELECT * EXCEPT
SELECT EXCEPT (col1, col2) returns every column except the ones you list. In BigQuery it also lowers on-demand cost, because excluded columns are not read: dropping a wide payload or blob column from SELECT can cut the bytes billed by most of the table.
SELECT * EXCEPT (column, ...) expands the star and leaves out the named columns. It works on a table alias too (o.* EXCEPT (internal_note)), and on a STRUCT value with .*. Each name must exist in the star expansion, otherwise the query fails, and column order is preserved. Snowflake has the same feature as EXCLUDE, Databricks as EXCEPT; PostgreSQL, MySQL and Redshift have nothing similar.
BigQuery stores tables by column and on-demand pricing bills the bytes of the columns a query reads. SELECT * reads every column, so excluding a large column you don't need (raw JSON payloads, HTML, embeddings, long text) removes its bytes from the bill. The same logic applies to CREATE TABLE AS SELECT: CREATE OR REPLACE TABLE t AS SELECT * EXCEPT (big_col) FROM t is the documented way to physically drop a column and reclaim its storage immediately, since ALTER TABLE DROP COLUMN only removes it from the schema.
The modifier only removes columns. To change the value of a column while keeping its name and position, use SELECT * REPLACE; both can be combined, with EXCEPT first. Do not confuse it with the EXCEPT DISTINCT set operator, which removes rows that appear in a second query; see UNION, INTERSECT and EXCEPT.
Syntax
SELECT [expression.]* EXCEPT (column_name[, ...]) [REPLACE (expression AS column_name[, ...])]
FROM ...Arguments and return value
| Argument | Description |
|---|---|
column_name | A column of the star expansion to leave out. Unqualified names only: EXCEPT (o.status) is not valid; qualify the star instead, o.* EXCEPT (status). |
expression.* | Optional table alias or STRUCT value whose columns or fields are expanded, such as o.* or payload.*. |
Returns: All columns of the star expansion except the listed ones, in their original order.
Examples
Drop internal columns from a result
WITH users AS (
SELECT 42 AS user_id, 'ana@example.com' AS email, 'x9f$2a' AS password_hash, 'DE' AS country
)
SELECT * EXCEPT (password_hash, email)
FROM users;| user_id | country |
|---|---|
| 42 | DE |
Exclude columns from one side of a join
USING already returns customer_id once; c.* EXCEPT removes the duplicate timestamp column from the customers side.
WITH orders AS (
SELECT 1001 AS order_id, 7 AS customer_id, 89.90 AS amount, TIMESTAMP '2026-11-20 10:00:00' AS created_at
),
customers AS (
SELECT 7 AS customer_id, 'Acme GmbH' AS name, TIMESTAMP '2024-02-01 00:00:00' AS created_at
)
SELECT o.*, c.* EXCEPT (customer_id, created_at)
FROM orders AS o
JOIN customers AS c USING (customer_id);| order_id | customer_id | amount | created_at | name |
|---|---|---|---|---|
| 1001 | 7 | 89.9 | 2026-11-20 10:00:00 UTC | Acme GmbH |
Skip a heavy column to cut bytes billed
If raw_payload holds most of the table's bytes, this query bills a small fraction of SELECT *. A dry run shows the difference before you run it.
SELECT * EXCEPT (raw_payload)
FROM `project.dataset.webhook_events`
WHERE DATE(received_at) = '2026-11-22';Rewrite a table without a column to free its storage
ALTER TABLE DROP COLUMN does not free storage right away; recreating the table without the column does. On-demand this bills one scan of the remaining columns.
CREATE OR REPLACE TABLE `project.dataset.webhook_events` AS
SELECT * EXCEPT (raw_payload)
FROM `project.dataset.webhook_events`;Common mistakes
- Listing a column that is not in the star expansion, for example after a rename. The query fails with
Column c in SELECT * EXCEPT list does not exist; check the current schema. - Qualifying names inside EXCEPT.
SELECT * EXCEPT (o.status)is a syntax error (Expected ")" but got "."); writeSELECT o.* EXCEPT (status). - Confusing
SELECT * EXCEPTwith theEXCEPT DISTINCTset operator, which subtracts the rows of one query from another. - Expecting EXCEPT to save money on small tables. On-demand billing has a 10 MB minimum per table referenced, so below that size the column choice makes no difference to the bill.
- Rebuilding a partitioned table with
CREATE OR REPLACE TABLE ... AS SELECT * EXCEPT (...)and losing its partitioning and clustering. Repeat thePARTITION BY,CLUSTER BYandOPTIONSclauses in the statement.
Cost and performance
- On-demand, bytes billed are the sum of the columns read. Excluding a 2 TiB JSON column from a 2.2 TiB table cuts a full scan from about $13.75 to about $1.25 at $6.25 per TiB. Selecting only the columns you need saves even more than EXCEPT.
LIMITdoes not reduce bytes on an unclustered table, but EXCEPT does, because it removes whole columns from the scan.
FAQ
How do I select all columns except one in BigQuery?
SELECT * EXCEPT (column_name) FROM table. List several columns separated by commas, and use alias.* EXCEPT (...) to apply it to one table of a join.
Does SELECT * EXCEPT reduce query cost?
Yes on on-demand pricing: excluded columns are not read, so their bytes are not billed. The saving is large when the excluded column is large.
What is the Snowflake equivalent of SELECT * EXCEPT?
Snowflake writes it as SELECT * EXCLUDE (col). BigQuery has no EXCLUDE keyword; use EXCEPT.
Related
More query syntax
All BigQuery query syntax · All statements and clauses · BigQuery error messages
