Update table command syntax in Google Bigquery
Update a table in Bigquery:
UPDATE dataset.Inventory
SET quantity = quantity - 10
WHERE product like '%washer%';
To update all the rows in a table:
UPDATE dataset.Inventory
SET quantity = quantity - 10
WHERE 1 = 1;
Update from another table in Bigquery:
UPDATE dataset.Inventory i
SET quantity = n.quantity
FROM (\nselect quantity,product from dataset.NewArrivals\n)n
WHERE i.product = n.product;
nVector
posted onEnjoy 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
Post Comment