postgres中带有distinct的字符串_agg出现问题

我得到下面的查询错误。基本上使用|&amp不同的在一起

选择string_agg('pre'| | distinct user.col,'post')

像这样很好用

选择string_agg('pre'| | user.col,'post')

&这个

选择字符串\u agg(distinct user.col,'post')
选择字符串_agg(不同的'pre'| | user.col,'post')

由于上述情况将拒绝在不同的聚合中使用索引,因此将'pre'去掉

选择'pre'| | string_agg(distinct user.col,'postpre')

发表评论