微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

大查询中的联合

如何解决大查询中的联合

请问如何在 Big Query 中为 UNION 编写正确的查询

例如, 表 A = 有一些数据类型不是字符串的列。

enter image description here

表 B = 上图中没有这样的列。

谁能帮忙写出正确的查询

解决方法

尝试明确指定 null 值:

with table_a as (
  select 'from table a' as src,current_datetime() as datetime_column,1.5 as float_column,3 as integer_column
),table_b as (
  select 'from table b' as src
)
select * from table_a
union all
select src,null,null from table_b

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。