Reputation: 407
Hello I am Importing Google Analytics CostData to Google BigQuery each day, table is created like Costdata_yyyymmdd for each day. I need a joined result in a Select query for all the dates table.
TableName
Costdata_20180401
Costdata_20180402
Costdata_20180403
Costdata_20180404
Costdata_20180405 ..... Costdata_yyyymmdd
Required Result:
select * from Costdata_20180401
union all
select * from Costdata_20180402
union all Costdata_yyyymmdd
What would be the best approach in Google BigQuery to achieve this ?
Upvotes: 0
Views: 107
Reputation: 4746
You can use table wildcards for this https://cloud.google.com/bigquery/docs/reference/standard-sql/wildcard-table-reference
SELECT *
FROM ´Costdata_*´
WHERE _table_suffix
BETWEEN '20180401' AND '20180413'
Upvotes: 1