Mysql CONV
From w3cyberlearnings
Contents |
MySQL CONV Function
This function converts numbers from one number base to another, and it returns a string representation of the number. Return NULL whenever any argument is NULL.
Syntax CONV
- Convert: Number to convert (string)
- From: Base From
- To: Base To
CONV(Convert, From, TO);
Example 1
mysql> SELECT CONV(10,10,2); +---------------+ | CONV(10,10,2) | +---------------+ | 1010 | +---------------+ 1 row in set (0.00 sec)
Example 2
mysql> SELECT CONV(10,2,10); +---------------+ | CONV(10,2,10) | +---------------+ | 2 | +---------------+ 1 row in set (0.00 sec)
Example 3
mysql> SELECT CONV('EE',18,8); +-----------------+ | CONV('EE',18,8) | +-----------------+ | 412 | +-----------------+ 1 row in set (0.00 sec)