If the number given in the CONV() function does not match its base, MySQL will return 0 as output. Suppose, if we want to convert the decimal number 9 to a number in binary number system, then in this case the value of from_base must be 10, but if we provide 8 as the value of from_base, then MySQL will return 0 as output.
Examplemysql> Select CONV(9,8,2); +-------------+ | CONV(9,8,2) | +-------------+ | 0 | +-------------+ 1 row in set (0.00 sec)
We know that octal values must be between 0 and 7, so the number system for the number 9 must be decimal, which is 10.
The above is the detailed content of What happens if the value of the number 'N' in the CONV() function does not match its base?. For more information, please follow other related articles on the PHP Chinese website!