I have monthly Data in BigQuery but I want to create a yearly database, meaning combine the 12 subdatabase to 1.
How can it be done?
The structure is identical for all 12 databases in form:
Date, Name, Amount, Value, Type_of_Good
I thought JOIN might help me, but it is not the case.
Thanks
To append to or overwrite a table using query results, specify a destination table and set the write disposition to either: Append to table — Appends the query results to an existing table. Overwrite table — Overwrites an existing table with the same name using the query results.
You can implement the Merge query to perform the update, upsert, and delete operations on a Google BigQuery target in a single SQL statement.
The BigQuery CONCAT function allows you to combine (concatenate) one more values into a single result. Alternatively, you can use the concatenation operator || to achieve the same output.
you can use the following syntax
SELECT Date, Name, Amount, Value, Type_of_Good
FROM
(select Date, Name, Amount, Value, Type_of_Good from january ...),
(select Date, Name, Amount, Value, Type_of_Good from february ...),
...
(select Date, Name, Amount, Value, Type_of_Good from december ...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With