我正在尝试从查询中创建一个新表,在此过程中强制转换嵌套字段之一。 像这样:
#standardSQL
SELECT * EXCEPT (bid_info),
(SELECT AS STRUCT bid_info.* EXCEPT (clicks), CAST(bid_info.clicks AS NUMERIC) as clicks
FROM `testing.fb_ads.ads`) as bid_info
FROM `testing.fb_ads.ads`
我收到错误消息“标量子查询产生了多个元素”,并且查询执行似乎没有结束。
如何解决此查询?
答案 0 :(得分:1)
所以,我毕竟找到了解决方案,就可以了:
SELECT * EXCEPT (bid_info),
(SELECT AS STRUCT bid_info.* EXCEPT (clicks), CAST(bid_info.clicks AS NUMERIC) as clicks ) as bid_info
FROM `testing.fb_ads.ads`