In MySQL, how we can get the corresponding string representation of the binary value of a number?


In MySQL, BIN() function is used to get the corresponding string representation of the binary value of a number. It considers the number as a DECIMAL number.

Syntax

BIN(value)

Here value, a BIGINT number, is the number whose binary value is to be retrieved.

Example

mysql> Select BIN(15);
+---------+
| BIN(15) |
+---------+
| 1111    |
+---------+
1 row in set (0.00 sec)

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 30-Jul-2019

218 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements