«Back to Home

Oracle Jump Start

Topics

How To Use Mod Function In Oracle

Description
 
Mod function returns the reminder of m divided by n.
 
Syntax
1 
 
Calculation
2 

Mod function returns m, if n is 0 and Mod function uses Floor function in the formula.
 
Example
  1. Select Mod (12, 2)  
  2. From Dual;  
3
Example
  1. Select Mod (12.5, 2)  
  2. From Dual;   
4

Example 
  1. Select Mod (-10, 3)  
  2. From Dual;  
5
 
Example 
  1. Select Mod (-15, 0)  
  2. From Dual;  
6

Example
  1. Select Mod (12.5, 3.5)  
  2. From Dual;   
7

Summary
 
Thus, we learnt, Mod function returns the remainder of m divided by n. We learnt, how to use Mod function in Oracle with the examples