

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- 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?
- What is MySQL HEX() function and how it is different from CONV() function?
- 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 UNHEX() function?
- What is the use of MySQL SUBSTRING_INDEX() function?
- What is the purpose of MySQL TRIM() function?
- What is the use of MySQL CHAR() function?
- How to make MySQL result set the same as specified?
Advertisements