Home > Database > Mysql Tutorial > When MySQL arithmetic expression returns NULL?

When MySQL arithmetic expression returns NULL?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-09-11 19:29:02
forward
1383 people have browsed it

When MySQL arithmetic expression returns NULL?

We know that NULL is not a value and it is different from zero. MySQL arithmetic expression will return NULL if we use NULL in it. It can be understood through the following example -

Example

mysql> Select 100*NULL;
+----------+
| 100*NULL |
+----------+
|     NULL |
+----------+
1 row in set (0.00 sec)

mysql> Select 100+NULL;
+----------+
| 100+NULL |
+----------+
|     NULL |
+----------+
1 row in set (0.00 sec)
Copy after login

As can be seen from the above example, if we use NULL in an arithmetic expression, then the result itself is NULL .

The above is the detailed content of When MySQL arithmetic expression returns NULL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template