Top "Array-agg" questions

array_agg() is a database function to aggregate an attribute from different rows into a single array.

PostgreSQL array_agg order

Table 'animals': animal_name animal_type Tom Cat Jerry Mouse Kermit Frog Query: SELECT array_to_string(array_agg(animal_…

postgresql array-agg
How to remove duplicates, which are generated with array_agg postgres function

Does anyone an idea how to rewrite following SQL query to generate results, that would contains only one occurrence of …

sql postgresql select array-agg
how to make array_agg() work like group_concat() from mySQL

So I have this table: create table test ( id integer, rank integer, image varchar(30) ); Then some values: id | rank | image …

postgresql array-agg
How to aggregate two PostgreSQL columns to an array separated by brackets

I would like to concatenate two columns using a group-by query resulting in an array separed with brackets. I know …

sql arrays postgresql concatenation array-agg
How to count on a group by array_agg in PostgreSQL

Here is my SQL: SELECT t.uid, array_agg(t.place) FROM tour_tracking t WHERE (orderon::time BETWEEN '18:00:00…

sql postgresql group-by count array-agg