27 Sep 19 · npack · #Bigquery ·   Bookmark   ×

Insert table command syntax in Google Bigquery

INSERT using explicit values

INSERT into dataset.Inventory (product, quantity)
VALUES('top load washer', 10),
('front load washer', 20),
('dryer', 30),
('refrigerator', 10),
('microwave', 20),
('dishwasher', 30),
('oven', 5);

To insert from another table:

INSERT into dataset.Inventory_New (product, quantity, supply_constrained)
SELECT product, quantity, inventory_flag
FROM dataset.Inventory;

Or if the number of columns are the same:

INSERT into dataset.Inventory_New (product, quantity, supply_constrained)
SELECT * FROM dataset.Inventory;

npack

posted on 27 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