Computer >> Computer tutorials >  >> Programming >> MySQL

Do we have any lower and upper limit of base in MySQL CONV() function? What happens if out of limit base is provided in CONV() function?


The base must be greater than 2 and less than 36 i.e. the lower limit of a base is 2 and the upper limit is 36. It is applied to both from_base and to_base values. If in case we provide out of limit values of the base then MySQL returns NULL as the output. Following example will demonstrate it −

Example

mysql> Select CONV(10,10,38);

+----------------+
| CONV(10,10,38) |
+----------------+
| NULL           |
+----------------+

1 row in set (0.00 sec)

mysql> Select CONV(10,72,2);

+---------------+
| CONV(10,72,2) |
+---------------+
| NULL          |
+---------------+

1 row in set (0.00 sec)

mysql> Select CONV(10,10,1);

+---------------+
| CONV(10,10,1) |
+---------------+
| NULL          |
+---------------+

1 row in set (0.00 sec)