Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 Array_AGG 查询输出中删除方括号 {}?
ARRAY_AGG(DISTINCT(SGL.short_name))
从这个{01,02} 到这个01|02|
{01,02}
01|02|
谢谢!
改为使用string_agg。
string_agg
string_agg(DISTINCT SGL.short_name, '|')
使用array_to_string():
array_to_string()
ARRAY_TO_STRING(ARRAY_AGG(DISTINCT(SGL.short_name)), '|')