将字段去重并合并

 

-- 将字段去重并合并
select 
    concat_ws(',',collect_set(cast(id as string))) as wm
from (
    select 1 as id union all
    select 1 as id union all
    select 1 as id union all
    select 2 as id union all
    select 3 as id
) t1
;

 

posted @ 2019-07-22 18:01  chenzechao  阅读(613)  评论(0编辑  收藏  举报