您好我每天都会将Google Analytics CostData导入Google BigQuery,每天都会创建类似Costdata_yyyymmdd的表格。我需要在所有日期表的Select查询中加入结果。
表名
Costdata_20180401
Costdata_20180402
Costdata_20180403
Costdata_20180404
Costdata_20180405 ..... Costdata_yyyymmdd
必填结果:
select * from Costdata_20180401
union all
select * from Costdata_20180402
union all Costdata_yyyymmdd
Google BigQuery实现此目标的最佳方法是什么?
答案 0 :(得分:1)
您可以对此https://cloud.google.com/bigquery/docs/reference/standard-sql/wildcard-table-reference
使用表格通配符SELECT *
FROM ´Costdata_*´
WHERE _table_suffix
BETWEEN '20180401' AND '20180413'