GROUP_CONCAT

Sintassi

GROUP_CONCAT(espr)

Spiegazione

Questa funzione restituisce una stringa formata dai valori non-NULL concatenati, presi da gruppi. Restituisce NULL se non ci sono valori non-NULL.

La lunghezza massima del valore restituito è determinata dalla variabile group_contact_max_len, il cui valore predefinito è di 1024 byte.

La sintassi completa è la seguente:

GROUP_CONCAT([DISTINCT] espr [,espr ...]
             [ORDER BY {unsigned_integer | nome_colonna | espr}
                 [ASC | DESC] [,nome_colonna ...]]
             [SEPARATOR stringa])

Esempi

SELECT nome_studente,
       GROUP_CONCAT(voto_esame)
       FROM studenti
       GROUP BY nome_studente;

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.