把同一列作为字符串连接起来的SQL语句(Postgres)
2016-03-24我有一张这样的表:
想得到这样的数据: 14489, 689, 694, 18612, 14488...
也就是把id列用","连接起来。
解决方法是这样的:
select array_to_string(array(select id from series limit 10), ',');
我有一张这样的表:
想得到这样的数据: 14489, 689, 694, 18612, 14488...
也就是把id列用","连接起来。
解决方法是这样的:
select array_to_string(array(select id from series limit 10), ',');