Home >Database >Mysql Tutorial >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 -
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)
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!