阿里云presto的一些操作

1,将分组之后的string字符合并起来。如下所示:

select distinct item_id,array_join(array_agg(distinct name),',')           
from  shmods.mysql_shop_item_cids a 
inner join  shmods.mysql_s__categories b 
on cid=b.id
where a.item_id = '8299155472'
group by item_id

array_agg()将分组之后的数据合并成list;    array_join(,',')将list数据合并起来并用','合并成字符串;

 

 

参考地址:https://help.aliyun.com/document_detail/64035.html?spm=a2c4g.11186623.3.3.a7444bdadYqCz9

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章