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

MySQLMySQLi Database

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)
raja
Published on 20-Feb-2018 13:23:41
Advertisements