在postgres中的LISTAGG是什么? [英] What's the equivalent for LISTAGG in postgres?

查看:2310
本文介绍了在postgres中的LISTAGG是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须用最新的postgres替换Oracle驱动程序。

I have to replace the Oracle driver with the newest postgres.

Postgres不知道函数LISTAGG。

Postgres doesn't know the function LISTAGG. I have to concat values by comma separated.

在Postgres中的Oracle函数LISTAGG是什么?

What's the equivalent for the Oracle function LISTAGG in Postgres?

谢谢。

推荐答案

Postgres中的等效函数为 string_agg()

The equivalent function in Postgres is string_agg()

select string_agg(col,',') from my_table




string_agg :将输入值连接成字符串,用分隔符分隔

string_agg : input values concatenated into a string, separated by delimiter

这篇关于在postgres中的LISTAGG是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆