SELECT
*
FROM TABLE_DATE_RANGE(dataset.tableA, DATE_ADD(CURRENT_TIMESTAMP(), -1,'day'), DATE_ADD(CURRENT_TIMESTAMP(), -1, 'day')) AS org_table
JOIN (
SELECT
name,
id
FROM
dataset.tableB) AS new_table
ON
org_table.id = new_table.id
BigQuery不允许我为TABLE_DATE_RANGE()提供别名,如何进行此连接?
答案 0 :(得分:4)
SELECT
*
FROM (
SELECT *
FROM TABLE_DATE_RANGE(dataset.tableA, DATE_ADD(CURRENT_TIMESTAMP(), -1,'day'), DATE_ADD(CURRENT_TIMESTAMP(), -1, 'day'))
) AS org_table
JOIN (
SELECT
name,
id
FROM
dataset.tableB) AS new_table
ON
org_table.id = new_table.id