Oracle MOD() function
Description
The Oracle MOD() is used to return the remainder of a dividend divided by a divisor. This function also works on fractional values and returns the exact remainder. The function returns dividend when the value of divisor is 0.
The function takes any numeric or nonnumeric data type (can be implicitly converted to a numeric data type) as an argument.
If the argument is BINARY_FLOAT, then the function returns BINARY_DOUBLE. Otherwise, the function returns the same numeric data type as the argument
Syntax:
MOD(N,M)
Arguments:
Name | Description |
---|---|
N | Dividend. |
M | Divisor. |
Pictorial Presentation of MOD() function

Example-1:
The statement below returns the remainder of17 divided by 2.
SELECT MOD(7,2) FROM dual;
Here is the result.
MOD(7,2) ---------- 1
Example-2:
The statement below returns the remainder of 7 divided by -2.
SELECT MOD(7,-2) FROM dual;
Here is the result.
MOD(7,-2) ---------- 1
Example-3:
The statement below returns the remainder of -7 divided by 2.
SELECT MOD(-7, 2);
Here is the result.
MOD(-7,2) ---------- -1
Example-4:
The statement below returns the remainder of -7 divided by -2.
SELECT MOD(-7, -2);
Here is the result.
MOD(-7,-2) ---------- -1
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook