The MOD() function returns the remainder derived by dividing two numbers. : MOD « Math « SQL / MySQL






The MOD() function returns the remainder derived by dividing two numbers.

    
mysql>
mysql>
MOD(<number1>, <number2>)
mysql>
mysql>
mysql> SELECT MOD(22, 7);
+------------+
| MOD(22, 7) |
+------------+
|          1 |
+------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.MOD in MySQL
2.Use the MOD() function to divide the Amount values by 10 and then return the remainder from that division.
3.modulus operator
4.Treat Monday as the first day of the week and Sunday as the last, use a the MOD( ) function to map Monday to 0