Domande taggate «array-agg»

2
Ordine array_agg PostgreSQL
Tabella "animali": 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; Risultato atteso: Tom;Jerry;Kerimt, Cat;Mouse;Frog OR Tom;Kerimt;Jerry, Cat;Frog;Mouse Posso essere sicuro che l'ordine nella prima funzione di aggregazione sarà sempre lo stesso della seconda. Voglio dire che non vorrei ottenere: Tom;Jerry;Kermit, Frog;Mouse,Cat
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.