The BIN() function in MySQL is used to convert a decimal number to its binary equivalent.The BIN() function is equivalent to the CONV() function written in the format CONV(number,10,2). In this format CONV() function converts the number ‘number’ from base 10(decimal) to base 2(binary).
BIN( NUM )
NUM:It is the decimal number whose binary equivalent you want to find.
The BIN() function returns a string value, the binary equivalent of the decimal number passed as argument. It returns NULL if the number is NULL.
Converting 5 to its binary equivalent.
- Converting 12 to its binary equivalent.
- Converting 97 to its binary equivalent.
- MySQL | LAST_DAY() Function
- MySQL | DEFAULT() Function
- MySQL | Group_CONCAT() Function
- MySQL | LEAD() and LAG() Function
- MySQL | Creating stored function
- MySQL | Common MySQL Queries
- How to get ID of the last updated row in MySQL?
- PHP | MySQL WHERE Clause
- IFNULL in MySQL
- MongoDB vs MySQL
- Different types of Procedures in MySQL
- PHP | MySQL LIMIT Clause
- Difference between MySQL and MS SQL Server
- MySQL | RENAME USER
- MySQL | DROP USER
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.