- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What happens if the value of number โNโ in CONV() function is not as per accordance with its base?
MySQL returns 0 as output if the number given in CONV() function is not as per accordance with its base. Suppose, if we want to convert decimal number 9 into the 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 returns 0 as output.
Example
mysql> Select CONV(9,8,2); +-------------+ | CONV(9,8,2) | +-------------+ | 0 | +-------------+ 1 row in set (0.00 sec)
As we know that the values of octal number system must be between 0 to 7, hence the number system for number 9 must be decimal i.e. 10.
Advertisements