Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
BIN
On this page
The BIN() function returns a string representation of the binary value of N, where N is a longlong (BIGINT) number.
This is equivalent to CONV(N,10,2).
Syntax
BIN ( expression )
Note
The function BINARY is not an alias for BIN.
Arguments
-
expression: any valid numeric expression.
Return Type
A string containing numeric value, in binary.
Examples
SELECT BIN(1234);
+-------------+
| BIN(1234) |
+-------------+
| 10011010010 |
+-------------+SELECT BIN(1234.5678);
+----------------+
| BIN(1234.5678) |
+----------------+
| 10011010010 |
+----------------+Last modified: