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


MySQL TUTORIALS » Math Numeric Functions » MOD »

 

MOD(N,0) returns NULL.


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 |
+-------------+
row in set (0.00 sec)

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

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Math Numeric Functions
» MOD