MOD function

MOD returns the remainder (modulus) of argument 1 divided by argument 2. The result is negative only if argument 1 is negative.


mod(integer_type, integer_type) 
The result of the function is:
  • SMALLINT if both arguments are SMALLINT.
  • INTEGER if one argument is INTEGER and the other is INTEGER or SMALLINT.
  • BIGINT if one integer is BIGINT and the other argument is BIGINT, INTEGER, or SMALLINT.

The result can be null; if any argument is null, the result is the null value.