Home >Database >Mysql Tutorial >What will MySQL return if we convert an empty hex value to a number?

What will MySQL return if we convert an empty hex value to a number?

王林
王林forward
2023-09-13 23:53:021008browse

如果我们将空的十六进制值转换为数字,MySQL 将返回什么?

We know that an empty hex value is a zero-length binary string, so if you add 0 to it, the result will 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)

The above is the detailed content of What will MySQL return if we convert an empty hex value to a number?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete