Calculates the remainder after dividing two values, <value_n> / <value_d>.

Syntax

MOD(<value_n>,<value_d>)

Parameters

ParameterDescriptionSupported input types
<value_n>The numerator of the division equationINT, BIGINT
<value_d>The denominator of the division equationINT, BIGINT

Return Type

BIGINT if one of the inputs is BIGINT. INT, otherwise.

Example

The following example returns the remainder of 45 divided by 7: