sql STRING_AGG 作用优先级


with f as (select * from UNNEST([1, 3,8,9,13,23, 5, 4, 23,55,77,6]) as fruit ) 
SELECT *,
  STRING_AGG(cast(fruit  as string), " , ") OVER (ORDER BY fruit  ROWS BETWEEN 0 FOLLOWING AND 3 FOLLOWING)  as click_history
FROM f where fruit>4 ;
STRING_AGG 的作用优先级别在where 语句之后,就是先把数据选出来,然后再进行 STRING_AGG

sql STRING_AGG 作用优先级_第1张图片

你可能感兴趣的:(sql)