See More

-- bigquery sample SQL MERGE dataset.DetailedInventory T USING dataset.Inventory S ON T.product = S.product WHEN NOT MATCHED AND s.quantity < 20 THEN INSERT(product, quantity, supply_constrained, comments) VALUES(product, quantity, true, ARRAY>[(DATE('2016-01-01'), 'comment1')]) WHEN NOT MATCHED THEN INSERT(product, quantity, supply_constrained) VALUES(product, quantity, false) ;