CONV
Descriptionβ
Do radix conversion for input parameter.
Syntaxβ
CONV(<input>, <from_base>, <to_base>)
Parametersβ
Parameter | Description |
---|---|
<input> | Parameters to be converted, either as strings or integers |
<from_base> | Numeric, the source base, within [2,36] . |
<to_base> | Numeric, the target base, within [2,36] . |
Return Valueβ
The number under the converted target binary <to_base>
is returned as a string.
Examplesβ
SELECT CONV(15,10,2);
+-----------------+
| conv(15, 10, 2) |
+-----------------+
| 1111 |
+-----------------+
SELECT CONV('ff',16,10);
+--------------------+
| conv('ff', 16, 10) |
+--------------------+
| 255 |
+--------------------+
SELECT CONV(230,10,16);
+-------------------+
| conv(230, 10, 16) |
+-------------------+
| E6 |
+-------------------+