阿里雲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

 

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