SQL MOD() Function

SQL MOD() Function return the reminder value of n1 divide by n2. Where n1 and n2 is natural value.

SQL MOD() function explicitly uses FLOOR() function to finding modulus formula.

Supported Oracle SQL Version

  • Oracle 8i
  • Oracle 9i
  • Oracle 10g
  • Oracle 11g
  • Oracle 12c
  • Oracle 18c

Syntax

MOD( n1, n2 )

Example :

Consider following MOD(24, 7) function return 24 divide by 7.

SQL> SELECT MOD(24,7) "MOD" FROM DUAL;

       MOD
----------
         3

SQL> SELECT MOD(20, 3) "MOD" FROM DUAL;

       MOD
----------
         2