MOD
This section contains reference documentation for the MOD function.
Last updated
Was this helpful?
This section contains reference documentation for the MOD function.
Modulo (remainder) of two values. This is a polymorphic function that preserves the input numeric type.
MOD(col1, col2)
col1
INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL
Dividend
col2
INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL
Divisor
Returns the same numeric type as the inputs (or the wider type if inputs differ).
select MOD(12, 5) AS value
from ignoreMe2
select MOD(12, 2) AS value
from ignoreMe0
select MOD(12L, 5) AS long_mod, MOD(12.5F, 5.0F) AS float_mod, MOD(12.5, 5.0) AS double_mod
from myTableReturns LONG, FLOAT, DOUBLE respectively (preserving input type).
Last updated
Was this helpful?
Was this helpful?

