
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is MySQL MAKE_SET() function?
MySQL MAKE_SET() function converts the decimal number in bits to binary and returns a set value(i.e. comma-separated list of values) for all bits that are set in that number using 1st string for the low-order bit, 2nd string for the next lowest bit and so on.
Syntax
MAKE_SET(bits, str1, str2,…)
Here,
- the bit is an expression, can have a decimal or binary value.
- Str1, str2… is the list of strings.
Example
mysql> Select MAKE_SET(1|2|4, 'Tutorials','Point','.com'); +---------------------------------------------+ | MAKE_SET(1|2|4, 'Tutorials','Point','.com') | +---------------------------------------------+ | Tutorials,Point,.com | +---------------------------------------------+ 1 row in set (0.00 sec)
Here, in the above example, first bit is 1 i.e. 001, the rightmost digit is 1 hence it returns ‘Tutorials’, second bit is 2 i.e. 010, the middle digit is 1 hence it returns ‘Point’ and third bit is 4 i.e. 100, the leftmost digit is 1 hence it returns ‘.com’.
- Related Articles
- What is MySQL ELT() function?
- What is MySQL OCTET_LENGTH() function?
- What is MySQL INTERVAL() function?
- How to make a MySQL Connection in JAVA? What is the port number to set on locahost?
- How to make MySQL result set the same as specified?
- What is the meaning of ‘empty set’ in MySQL result set?
- What is the use of MySQL FROM_UNIXTIME() function?
- What is the use of MySQL GET_FORMAT() function?
- What is the use of MySQL LAST_INSERT_ID() function?
- What is the use of MySQL CONCAT_WS() function?
- What is the use of MySQL TRUNCATE() function?
- What is the use of MySQL SUBSTRING_INDEX() function?
- What is the use of MySQL UNHEX() function?
- What is the use of MySQL CHAR() function?
- What is the purpose of MySQL TRIM() function?

Advertisements