EXPORT_SET
Syntax
EXPORT_SET(bits,on,off[,separator[,number_of_bits]])
Description
Returns a string where for each bit set in the bits value, the string on is added, and for each bit not set in the bits value, the string off is added. The bits are checked from right to left (least significant to most significant).
The strings are added to the result from left to right, separated by the separator string (default is the comma character ","). The number of bits to check is given by number_of_bits, which defaults to 64 if not specified. If number_of_bits is greater than 64, it will be silently truncated to 64. number_of_bits is treated as an unsigned integer, so the value -1 is equivalent to 64.
Examples
SELECT EXPORT_SET(6, '1','0',',', 10);
+--------------------------------+
| EXPORT_SET(6, '1','0',',', 10) |
+--------------------------------+
| 0,1,1,0,0,0,0,0,0,0 |
+--------------------------------+
1 row in set (0.001 sec)