Provide the remainder resulting from dividing 18 by 4.
| SELECT MOD(18, 4); |
The MOD() function computes the remainder when dividing one number by another.
| MOD(x, y) |
OR:
x MOD y
|
OR:
x % y
|
|
Parameter |
Description |
|
x |
Mandatory: A value that will undergo division by y. |
|
y |
Mandatory: The number by which the value will be divided. |
| Works in: | From MySQL 4.0 |
Find the remainder when 18 is divided by 4.
| SELECT 18 MOD 4; |
Calculate the remainder from the division of 18 by 4.
| SELECT 18 % 4; |