GROUP_CONCAT

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

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 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.