

- 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
Which function in MySQL returns the same output as BIN() function?
As we know that BIN() function returns the binary string of a number, of the DECIMAL base, after converting it into a binary value. In this way, it can be considered same as CONV(N,10,2) function. It means the output of CONV(N,10,2) would be same as the output of BIN() function.
In CONV(N,10,2) function, ‘N’ is the number which will be converted, 10 represents the base, i.e. DECIMAL, of N and 2 represents that we want to convert N into a binary string.
Example
The example below will demonstrate that the output return by BIN() is same as CONV(N,10,2)
mysql> Select BIN(15); +---------+ | BIN(15) | +---------+ | 1111 | +---------+ 1 row in set (0.00 sec) mysql> Select CONV(15,10,2); +---------------+ | CONV(15,10,2) | +---------------+ | 1111 | +---------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- When MySQL LOCATE() function returns NULL as the output?
- When MySQL SUBSTRING_INDEX() function returns the same string, provided in the argument, as output?
- When MySQL FIND_IN_SET() function returns NULL as output?
- Which MySQL function returns a specified number of characters of a string as output?
- Which MySQL functions work as similar as LOCATE() function?
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- How can I use SUBSTRING_INDEX() function to get the substring as output which is between two same delimiters in a string?
- How can we use BIN() function with MySQL WHERE clause?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- How to obtain the same font in Matplotlib output as in LaTex output?
- What MySQL CONCAT() function returns by passing the numeric arguments?
- What MySQL returns on passing an invalid string as an argument to STR_TO_DATE() function?
- What MySQL returns if we use NULL, as both the arguments, as one of the argument and as a separator, in CONCAT_WS() function?
- How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?
Advertisements