Skip to content
Advertisement

Tag: postgresql

Concatenate multiple rows in an array with SQL on PostgreSQL

I have a table constructed like this : I’d like to query this table to get a result like this : I can’t figure a way to do that. Is that possible? How? Answer This is a Postgres built-in since a few versions so you no longer need to define your own, the name is array_agg(). (this is Postgres 8.4.8).

Advertisement