Database:PostgreSQL 9.4.24
报错信息显示:函数 group_concat(character varying) 不存在,通过查资料发现。

PostgreSQL里面没有group_concat函数(MySQL里面有—),为了使用group_concat这一功能,我们可以用array_agg 和
array_to_string 取而代之。array_agg 和 array_to_string同样可以用于其他数据库,用于达到group_concat这一功能。

**结论Conclusion**There is no function like group_concat available in PostgreSQL which was available in MySQL, instead of using this function we are using array_agg and array_to_string function. Array_agg and array_to_string function will work same as group_concat function work in other databases. We can also use string_agg function in PostgreSQL.

Example

分隔符separator可以自己选
select address, array_to_string(array_agg(name order by name), '"') from group_concat group by address;
select address, array_to_string(array_agg(name order by name), ',') from group_concat group by address;

https://www.educba.com/postgresql-group_concat/

PostgreSQL查看版本信息

https://blog.csdn.net/kmblack1/article/details/78721653

ERROR: function group_concat(character varying) does not exist相关推荐

  1. PostgreSQL报错 ERROR: function sum(character varying) does not exist

    1:SUM 函数只能用于数值类型的数据,例如整数.浮点数等.而你的代码中,可能将一个字符型的字段传递给了 SUM 函数,导致无法识别函数.因此,建议你检查一下代码中使用 SUM 函数的部分,看一下传递 ...

  2. PostgreSQL ERROR: operator does not exist: bigint = character varying

    在使用PostgreSQL数据库过程中,遇到提示:ERROR: operator does not exist: bigint = character varying 这个错误提示是由于在查询中使用了 ...

  3. JPA ERROR: value too long for type character varying(100)

    生产上出现问题,一个功能导入Excel,本来代码中写的是两万条记录,但是现实是只能导入20条记录.然后查看日志发现报错. ERROR: value too long for type characte ...

  4. 使用string_to_array时,报错operator does not exist: character varying = text[]

    我: 在pgsql中使用 a.type in ( string_to_array( (select cii.type from cinfo cii where cii.cidx = a.cidx), ...

  5. SpringBoot:ERROR: column “***“ is of type numeric but expression is of type character varying

    问题 SpringBoot:在postgresql数据库提交数据时,出现ERROR: column "***" is of type numeric but expression ...

  6. 关于字段超长导致的插入错误的提示信息(value too long for type character varying)

    关于字段超长导致的插入错误的提示信息 背景 你们肯定遇到过这样的错误,跑的程序需要插入或更新一张表,值的长度超过字段最大限制而报错.要如何定位是哪个字段长度过小导致的? 方法 1.先要获取错误信息 最 ...

  7. error Unnecessary escape character: \- no-useless-escape

    前端vue中需要格式化时间字符串'2021-03-18 19:29:47'为'2021-03-18'. 页面元素 <el-col class="publishdate"> ...

  8. 解决报错:error: function declaration isn’t a prototype [-Werror=strict-prototypes]

    下午在写C语言代码,编译时报错如下: error: function declaration isn't a prototype [-Werror=strict-prototypes]void my_ ...

  9. ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法

    sass文件编译时候使用ruby环境,无论是界面化的koala工具还是命令行模式的都无法通过,真是令人烦恼. 容易出现中文注释时候无法编译通过,或者出现乱码,找了几天的解决方法终于解决了. 这个问题的 ...

  10. 成功解决Error:invalid character in identifier

    成功解决Error:invalid character in identifier 目录 解决问题 解决思路 解决方法 解决问题 解决思路 错误:标识符中的字符无效 解决方法 将单引号改为双引号即可! ...

最新文章

  1. 实验三 ShellShock 攻击实验
  2. Ubuntu创建新用户并增加管理员权限
  3. SCCM 2012 R2---配置客户端发现方法和边界组
  4. 微信小程序开发遇到的那些“坑”(1.2.0-1.4.0)
  5. Python-OpenCV 杂项(二): 鼠标事件
  6. Java集合Stack源码深入解析
  7. 如何在python中构造时间戳参数
  8. Sentinel实现限流熔断及与Spring Cloud整合
  9. datagridview 不显示行号的问题
  10. SQL语法中的JOIN类型
  11. Asp.net中模仿Winform的MessageBox
  12. 南昌大学2021年811考研真题+答案详解
  13. CLOSE_WAIT状态的原因与解决方法
  14. 绿色版飞信2008 启动时报错“无法注册类别...”的解决办法
  15. H3C_利用设置缺省静态路由优先级实现出口双线路的主备功能
  16. ESP8266-连接阿里云示例
  17. “辣条大王”卫龙奔向港交所 能否撑起600亿估值?
  18. 我参加筑路机械专业筹建过程的回忆
  19. 让模糊图片变清晰:滴滴云推出图像超分辨API,新用户免费调用100次
  20. ​定了,北京时间 9 月 16 日凌晨 1 点见。

热门文章

  1. 集成Atlas到现有的网站项目中--决定弃用Ajaxpro转用Atlas了
  2. Keil/MDK(0):使用过程中的一些设置
  3. html{-webkit-text-size-adjust:none;}(取消浏览器最小字体限制)
  4. Excel--数据分列功能
  5. 玉伯 对 前端的 金玉良言
  6. SQL使用技巧(转)
  7. Python中ASCII码的数字和字符的转换
  8. 软件体系架构课后作业04
  9. [老文章搬家] 插件化软件设计的头疼问题以及可能的解决思路
  10. java:高速排序算法与冒泡排序算法