MOD
Descriptionβ
Find the remainder of a divided by b for the integer type. For the floating-point type, please use the fmod function.
Syntaxβ
MOD(<col_a> , <col_b>)
Parametersβ
Parameter | Description |
---|---|
<col_a> | Dividend |
<col_b> | Divisor should not be 0 |
Return valueβ
Return an integer type. Special cases:
If col_a IS NULL or col_b IS NULL, return NULL.
Exampleβ
select mod(10, 3);
+----------+
| (10 % 3) |
+----------+
| 1 |
+----------+
select mod(10, 0);
+----------+
| (10 % 0) |
+----------+
| NULL |
+----------+