Converts decimal numbers to binary text.
BIN(<a>)
| Parameter | Description |
|---|---|
<a> | Decimal value to be converted |
The binary representation of the parameter <a>. When <a> is negative, the result is its 64-bit complement.
select bin(0);
+--------+ | bin(0) | +--------+ | 0 | +--------+
select bin(-1);
+------------------------------------------------------------------+ | bin(-1) | +------------------------------------------------------------------+ | 1111111111111111111111111111111111111111111111111111111111111111 | +------------------------------------------------------------------+
select bin(123);
+----------+ | bin(123) | +----------+ | 1111011 | +----------+