PostgreSQL array_to_string array

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/spencer_tseng/article/details/81946124
select 
a.pub_id, 
a.group_name
from t_onlyou_wx_fans_label a where a.pub_id = '1BUSRGK7E0001AFCFEA90000BA352ED7';

select 
distinct
a.pub_id, 
array_to_string(array(SELECT b.group_name FROM  t_onlyou_wx_fans_label b  WHERE b.pub_id = a.pub_id), ',') as group_name
from t_onlyou_wx_fans_label a where a.pub_id = '1BUSRGK7E0001AFCFEA90000BA352ED7';

=============================

ORACLE: wm_concat

SELECT

other_colums,

扫描二维码关注公众号,回复: 2968346 查看本文章

wmsys.wm_concat (join_colum) as join_result

                FROM table_name

                             GROUP BY other_colums

猜你喜欢

转载自blog.csdn.net/spencer_tseng/article/details/81946124