20 Sep 19 · npack ·       Add to Favorites  

SELECT * EXCEPT a specific COLUMN in Bigquery - Syntax

A SELECT * EXCEPT statement specifies the names of one or more columns to exclude from the result set. All matching column names are omitted from the output.

WITH orders AS
(SELECT 5 as order_id,
"sprocket" as item_name,
200 as quantity)
SELECT * EXCEPT (order_id)
FROM orders;
+-----------+----------+
| item_name | quantity |
+-----------+----------+
| sprocket | 200 |
+-----------+----------+

Note: SELECT * EXCEPT does not exclude columns that do not have names.

npack

posted on 20 Sep 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds

Copied