Bigquery SQL标准中的Nest函数 [英] Nest function in Bigquery SQL standard
本文介绍了Bigquery SQL标准中的Nest函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在标准SQL中,旧式SQL中的nest
函数等于什么.我希望将来源和媒介汇总如下:
What is the equal of nest
function from legacy SQL in standard SQL. I wish to aggregated source and medium as follows:
NEST(trafficSource.source + '>' + trafficSource.medium) as source
推荐答案
您需要在CONCAT
中使用ARRAY_AGG
或STRING_AGG
来代替NEST
:
Instead of NEST
with +
, you need to use ARRAY_AGG
or STRING_AGG
with CONCAT
:
ARRAY_AGG(CONCAT(trafficSource.source, '>', trafficSource.medium)) as source
或者:
STRING_AGG(CONCAT(trafficSource.source, '>', trafficSource.medium)) as source
第一个返回一个数组,而第二个返回一个用逗号分隔的字符串.
The first one returns an array, whereas the second returns a comma-separated string.
这篇关于Bigquery SQL标准中的Nest函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文