tech on the net
Home About Us Feedback Site Map


Access Excel Word


SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker


C Language


ASCII Table Linux UNIX Java Clipart Joke of the Moment
Share this page:

Oracle/PLSQL: MOD Function

Learn how to use the Oracle/PLSQL MOD function with syntax and examples.


The Oracle/PLSQL MOD function returns the remainder of m divided by n.


The syntax for the Oracle/PLSQL MOD function is:

MOD( m, n )

Parameters or Arguments

The MOD is calculated as:

m - n * floor(m/n)


The MOD function uses the floor function in its formula, whereas the REMAINDER function uses the ROUND function in its formula.

The MOD function returns m if n is 0.

Applies To

The MOD function can be used in the following versions of Oracle/PLSQL:

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


Let's look at some Oracle MOD function examples and explore how to use the MOD function in Oracle/PLSQL.

For example:

MOD(15, 4) would return 3
MOD(15, 0) would return 15
MOD(11.6, 2) would return 1.6
MOD(11.6, 2.1) would return 1.1
MOD(-15, 4) would return -3
MOD(-15, 0) would return -15