MAKE_SET
Stai visualizzando una vecchia versione di questo article. Visualizza
la versione più recente.
Sintassi
MAKE_SET(bit, str1, str2,...)
Spiegazione
Restituisce un valore set (una stringa contenente le sottostringhe separate da caratteri ","), formata dalle stringhe che corrispondono ai bit impostati a vero nell'argomento bit. str1 corrisponde al bit 0, str2 al bit 1, e così via. I valori NULL in str1, str2, etc, non vengono aggiunti al risultato.
Esempi
MariaDB [(none)]> SELECT MAKE_SET(1,'a','b','c'); +-------------------------+ | MAKE_SET(1,'a','b','c') | +-------------------------+ | a | +-------------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT MAKE_SET(1 | 4,'hello','nice','world'); +----------------------------------------+ | MAKE_SET(1 | 4,'hello','nice','world') | +----------------------------------------+ | hello,world | +----------------------------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT MAKE_SET(1 | 4,'hello','nice',NULL,'world'); +---------------------------------------------+ | MAKE_SET(1 | 4,'hello','nice',NULL,'world') | +---------------------------------------------+ | hello | +---------------------------------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT QUOTE(MAKE_SET(0,'a','b','c')); +--------------------------------+ | QUOTE(MAKE_SET(0,'a','b','c')) | +--------------------------------+ | '' | +--------------------------------+ 1 row in set (0.00 sec)
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.