Syntax
MAKE_SET(bits,str1,str2,...)
Purpose
MAKE_SET() returns a set of strings corresponding to bits whose value is 1. The strings are separated with commas (,). The str1 string corresponds to bit 2^0^, str2 to bit 2^1^, and so on. If the strn string does not exist, NULL is returned.
For example, if you set bits to 5, whose binary value is 0101, then str1 and str3 are returned.
Examples
obclient> SELECT MAKE_SET(1,'a','b','c');
+-------------------------+
| MAKE_SET(1,'a','b','c') |
+-------------------------+
| a |
+-------------------------+
1 row in set
obclient> SELECT MAKE_SET(1 | 4,'hello','ocean','base');
+----------------------------------------+
| MAKE_SET(1 | 4,'hello','ocean','base') |
+----------------------------------------+
| hello,base |
+----------------------------------------+
1 row in set
obclient> SELECT MAKE_SET(1 | 4,'hello','ocean',NULL,'base');
+---------------------------------------------+
| MAKE_SET(1 | 4,'hello','ocean',NULL,'base') |
+---------------------------------------------+
| hello |
+---------------------------------------------+
1 row in set