4 ms·
Using array_agg in Postgres – powerful and flexible
- dcraw 14y agoCool. MySQL and SQLite both have something similar called group_concat. Useful for creating lists of ids to plug into another system.
- pjungwir 14y agoArrays are a really nice feature. As an aside, you can replace this line: array_to_string(array_agg(projects.name), ',')) with this: string_agg(projects.name, ',')