Postgresql - concat_ws 之类的函数? [英] Postgresql - concat_ws like function?
本文介绍了Postgresql - concat_ws 之类的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对 postgresql 有了第一次痛苦的体验,当下的挑战是:
I'm having a first painful experience with postgresql, and the minute-challenge of the moment is :
如何执行concat_ws 在 postgresql 中,从一个组中加入多个字段值:
How to perform a concat_ws in postgresql, to join several fields value from a group by :
select concat_ws(';',field_lambda) from table_lambda group by id;
推荐答案
对于 PostgreSQL 8.4 及更高版本:
For PostgreSQL 8.4 and above:
select ARRAY_TO_STRING(
ARRAY_AGG(field_lambda),';'
) from table_lambda group by id;
这篇关于Postgresql - concat_ws 之类的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文