MySQL CONV function is one of the Mathematical Function which is used to convert the user specified expression for one base to another base. This returns the string as an output.
In this article, we will show you, How to convert the numbers from one base to another base with an example.
MySQL CONV Syntax
The syntax of the CONV in MySQL is as shown below:
SELECT CONV(N, from_base, to_base);
This function accepts the base value from 2 as minimum to maximum 32.
MySQL CONV Function Example 1
The MySQL Convert Function is used to convert the given values between different bases. The following query will show multiple ways to use CONV function.
SELECT CONV(15, 10, 2), CONV(7, 10, 2);
SELECT CONV('a', 16, 2), CONV('f', 16, 2);
SELECT CONV('Hi', 18, 2), CONV('Hello', 18, 2);
Thank You for Visiting Our Blog