-- hive
SELECT
t.xm, t.sfzh,concat_ws(',', collect_set(t.rylx)) rylx
FROM
table t
GROUP BY
t.xm, t.sfzh
-- Presto
SELECT
t.xm, t.sfzh, array_join(array_agg(distinct t.rylx), ',') rylx
FROM
table t
GROUP BY
t.xm, t.sfzh
-- hive
SELECT
t.xm, t.sfzh,concat_ws(',', collect_set(t.rylx)) rylx
FROM
table t
GROUP BY
t.xm, t.sfzh
-- Presto
SELECT
t.xm, t.sfzh, array_join(array_agg(distinct t.rylx), ',') rylx
FROM
table t
GROUP BY
t.xm, t.sfzh