Home > Database > Mysql Tutorial > How can we use MySQL EXPORT_SET() function with columns of a table?

How can we use MySQL EXPORT_SET() function with columns of a table?

王林
Release: 2023-08-24 09:17:08
forward
864 people have browsed it

我们如何将 MySQL EXPORT_SET() 函数与表的列一起使用?

#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 -

Example

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template