
- 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
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 Articles
- 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?
- When MySQL LOCATE() function returns NULL as the output?
- Which MySQL function returns a specified number of characters of a string as output?
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- How can we use BIN() function with MySQL WHERE clause?
- Which MySQL functions work as similar as LOCATE() function?
- How can I use SUBSTRING_INDEX() function to get the substring as output which is between two same delimiters in a string?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What MySQL returns on passing an invalid string as an argument to STR_TO_DATE() function?
- What MySQL CONCAT() function returns by passing the numeric arguments?
- What is MySQL STRCMP() function and what would be the output of this function?

Advertisements