Presto/hive 一行转多行,多行合并成一行
presto-多行变一行
with t(id,a) as(
select '1','a' union all
select '2','c' union all
select '2','d' )
select id,array_join(array_agg(a), ',') from t
group by id
array_agg将数据整合起来变成一个列表,array_join将列表以指定分隔符连接起来
|
|
重感情的地瓜 · 是new image() ...· 1 年前 · |
|
|
行走的小摩托 · React.createContext ...· 1 年前 · |
|
|
面冷心慈的饺子 · delphi 数组的使用 - 王云盼 - 博客园· 2 年前 · |
|
|
呐喊的生姜 · SQL查询~ ...· 2 年前 · |
|
|
坚强的梨子 · c++ 中 char 与 ...· 2 年前 · |
|
|
面冷心慈的饺子 · delphi 数组的使用 - 王云盼 - 博客园 2 年前 |