Zayn_SE
Zayn_SE

Reputation: 173

BigQuery append data from csv to column

I have a BigQuery table where I added a new column and am not sure as to how I can append data to its row.

This is the BigQuery table:

enter image description here

This is the csv/excel file: I did try to upload the csv directly as a new table but had errors and am now trying to update the column named 'Max_Takeoff_kg', its the last column in the csv. How do I write a query within BigQuery to update the rows with the data in the csv in the last column.

enter image description here

Upvotes: 0

Views: 570

Answers (1)

rmesteves
rmesteves

Reputation: 4075

If you're loading your data only for this time, I'd recommend that you save your XLS as CSV and try to create a new table again.

Anyway, you can update your table using BigQuery DML as you can see here

Its important to remember that in your case, for this approach works correctly you must have a way to identify your rows uniquely.

Example:

UPDATE your_db.your_table
SET your_field = <value>
WHERE <condition_to_identify_row_uniquely>

I hope it helps

Upvotes: 1

Related Questions