#We can use the EXPORT_SET() function with columns of a table by providing an integer type column as the first parameter of the function. The following example will demonstrate it -
mysql> SELECT Id, EXPORT_SET(id,'1','0',' ',5)AS 'ID in bits' from student; +------+------------+ | Id | ID in bits | +------+------------+ | 1 | 1 0 0 0 0 | | 2 | 0 1 0 0 0 | | 15 | 1 1 1 1 0 | | 20 | 0 0 1 0 1 | | 21 | 1 0 1 0 1 | +------+------------+ 5 rows in set (0.00 sec)
Here we are using the "Id" column of the "Student" table as the parameter of the EXPORT_SET() function.
The above is the detailed content of How can we use MySQL EXPORT_SET() function with columns of a table?. For more information, please follow other related articles on the PHP Chinese website!