May 2005
Intermediate to advanced
352 pages
14h 39m
English
CONV( )
CONV(number,from_base,to_base)
This function converts a number from one numeric base system to another. The number to convert is given in the first argument, the base from which to convert the number in the second argument, and the base to which to convert the number in the third argument. The minimum base allowed is 2 and the maximum is 36.
SELECT CONV(4, 10, 2) AS 'Base-10 4 Converted', CONV(100, 2, 10) AS 'Binary 100 Converted'; +---------------------+----------------------+ | Base-10 4 Converted | Binary 100 Converted | +---------------------+----------------------+ | 100 | 4 | +---------------------+----------------------+
Here the number 4 under the base 10 system is converted to the base-two or binary equivalent and back again.
Read now
Unlock full access