Home » Bigquery » Tutorials » INSERT from a table

BigQuery INSERT into table from select

Use the INSERT statement to add new rows to a table from the results of a select query

INSERT from a table example

\nINSERT dataset.Inventory_New (product, quantity, supply_constrained)\nSELECT product, quantity, false FROM dataset.Inventory\n
\n\n

If the number of columns are the same, you can INSERT without column names

\n
\nINSERT dataset.Inventory_New (product, quantity, supply_constrained)\nSELECT product, quantity, false FROM dataset.Inventory\n

Syntax reference

INSERT [INTO] target_name\n [(column_1 [, ..., column_n ] )]\n input\n\ninput ::=\n VALUES (expr_1 [, ..., expr_n ] )\n        [, ..., (expr_k_1 [, ..., expr_k_n ] ) ]\n| SELECT_QUERY\n\nexpr ::= value_expression