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.
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.
Published on 20-Feb-2018 07:38:22
- Related Questions & Answers
- What MySQL returns if specified format string is not as per accordance with the date string passed as arguments to STR_TO_DATE() function?
- 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?
- What happens if a NULL argument is provided in MySQL CONV() function?
- What happens if the argument ‘count’ in MySQL SUBSTRING_INDEX() function has the value greater than the total number of occurrences of delimiter?
- What is the benefit of MySQL ‘IS NULL’ and ‘IS NOT NULL’?
- What is the purpose of ‘as’ operator in C#?
- What is the use of ‘ALL’, ‘ANY’, ’SOME’, ’IN’ operators with MySQL subquery?
- What happens when I insert the value ‘NULL’ in an AUTO_INCREMENT MySQL column?
- What happens if ++ operator is used with string value in PHP?
- What is the significance of ‘^’ in PHP?
- In function INSERT(str, Pos, len, newstr), what would be the result if ‘Pos’ is not within the length of the string?
- What happens if NullPointerException is not handled in main method of java?
- What happens with the output of MySQL EXPORT_SET() function if I will skip the value of the fifth argument i.e. a number of bits?
- In function INSERT(str, Pos, len, newstr), what would be the result if ‘len’ is not within the length of the rest of string?
- What is the purpose of ‘is’ operator in C#?