CONV
Convert numbers between bases. This function transforms a number from one numeric base system to another.
Syntax
CONV(N,from_base,to_base)Description
Examples
SELECT CONV('a',16,2);
+----------------+
| CONV('a',16,2) |
+----------------+
| 1010 |
+----------------+
SELECT CONV('6E',18,8);
+-----------------+
| CONV('6E',18,8) |
+-----------------+
| 172 |
+-----------------+
SELECT CONV(-17,10,-18);
+------------------+
| CONV(-17,10,-18) |
+------------------+
| -H |
+------------------+
SELECT CONV(12+'10'+'10'+0xa,10,10);
+------------------------------+
| CONV(12+'10'+'10'+0xa,10,10) |
+------------------------------+
| 42 |
+------------------------------+Last updated
Was this helpful?

