MAKE_SET(bits,str1,str2,...)
MAKE_SET function returns a set of values which are from string containing substrings separated by , characters, consisting of the strings that have the corresponding bit in bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. If there is any NULL value in str1, str2, ... then NULL values are not appended to the result.
Here are some example which will explain you this function-
mysql> SELECT MAKE_SET(1|4,'Hello','ABC','MySQL','.','XYZ');
+-----------------------------------------------+
| MAKE_SET(1|4,'Hello','ABC','MySQL','.','XYZ') |
+-----------------------------------------------+
| Hello,MySQL |
+-----------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT MAKE_SET(1|4,'A','B','C','D','E');
+-----------------------------------+
| MAKE_SET(1|4,'A','B','C','D','E') |
+-----------------------------------+
| A,C |
+-----------------------------------+
1 row in set (0.01 sec)
0 Comment(s)