我想从看起来相同的不同表(每日表)中选择相同的列。
我从具有相同结构答案的多个表中看到了这个SELECT,但如果我按照这个进行,我最终会得到一个巨大的查询。
这段代码与我所拥有的相似,根据上面的答案,我需要执行以下操作:
select a, b, c
from (
select a, b, c, d, e from hourly.16
union all
select a, b, c, d, e from hourly.15
)
是不是有一个选项来做这样的事情:
select a, b, c
from (
select a, b, c, d, e from (hourly.16 union all hourly.15)
)
所以我不会以大量的查询结束?
#standardSQL
SELECT a, b, c
FROM (
SELECT a, b, c, d, e
FROM `project.hourly.*`
WHERE _TABLE_SUFFIX BETWEEN '15' AND '16'
)
以上假设这hourly
是您的数据集
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句