Computer >> Computer tutorials >  >> Programming >> MySQL

What MySQL returns if we convert an empty hexadecimal value to a number?


As we know that an empty hexadecimal value is a zero-length binary string hence if 0 is added to it then the result would be 0. In other words, we can say that if we convert an empty hexadecimal value to a number then it produces 0. The following query will make it understand −

mysql> SELECT X''+ 0;
+--------+
| X''+ 0 |
+--------+
| 0      |
+--------+
1 row in set (0.15 sec)