Table "animals":
animal_name animal_type Tom Cat Jerry Mouse Kermit Frog
Query:
SELECT array_to_string(array_agg(animal_name),';') animal_names, array_to_string(array_agg(animal_type),';') animal_types FROM animals;
Expected Result:
Tom;Jerry;Kerimt, Cat;Mouse;Frog OR Tom;Kerimt;Jerry, Cat;Frog;Mouse
Can I be sure that the order in the first aggregated function will always be the same as in the second. I mean, what I would like to get:
Tom;Jerry;Kermit, Frog;Mouse,Cat
postgresql array-agg
Olo Sep 06 2018-11-11T00: 00Z
source share