MOD(N,0) returns NULL. : MOD « Math Numeric Functions « MySQL Tutorial






MOD() also works on values that have a fractional part and returns the exact remainder after division:

mysql>
mysql> SELECT MOD(34.5,3);
+-------------+
| MOD(34.5,3) |
+-------------+
|         1.5 |
+-------------+
1 row in set (0.00 sec)

mysql>
mysql>
mysql> select MOD(3,0);
+----------+
| MOD(3,0) |
+----------+
|     NULL |
+----------+
1 row in set (0.00 sec)

mysql>








21.24.MOD
21.24.1.MOD(N,M), N % M, N MOD M: modulo operation. returns the remainder of N divided by M.
21.24.2.MOD(N,0) returns NULL.
21.24.3.The modulo function returns the remainder of two numbers.
21.24.4.(MOD(4, 0)) will return a null value