PLSQL | MOD Function Last Updated : 18 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The MOD function is an inbuilt function in PLSQL which is used to return the remainder when a is divided by b. Its formula is m - n * \left\lfloor\dfrac{m}{n}\right\rfloor. Syntax: MOD(a, b) Parameters Used: This function accepts two parameters a and b. This function gives remainder as the output when the input number a is divided by b. Return Value: This function returns the remainder when a is divided by b. Supported Versions of Oracle/PLSQL is given below: Oracle 12c Oracle 11g Oracle 10g Oracle 9i Oracle 8i Let's see some examples which illustrate the MOD function: Example-1: DECLARE Test_Number number1 := 15; Test_Number number2 := 4; BEGIN dbms_output.put_line(MOD(Test_Number number1, Test_Number number2)); END; Output: 3 In the above example, when the numeric value 15 is divided by 4 then it returns the remainder of 3 as output. Example-2: DECLARE Test_Number number1 := 15; Test_Number number2 := 0; BEGIN dbms_output.put_line(MOD(Test_Number number1, Test_Number number2)); END; Output: 15 In the above example, when the numeric value 15 is divided by 0 then it returns the remainder of 15 as output. Example-3: DECLARE Test_Number number1 := 11.6; Test_Number number2 := 2.1; BEGIN dbms_output.put_line(MOD(Test_Number number1, Test_Number number2)); END; Output: 1.1 In the above example, when the numeric value 11.6 is divided by 2.1 then it returns the remainder of 1.1 as output. Advantage: This function is used to find the remainder when a is divided by b. Comment More infoAdvertise with us Next Article PLSQL | MOD Function K Kanchan_Ray Follow Improve Article Tags : SQL SQL-PL/SQL Similar Reads PLSQL | LOG Function The PLSQL LOG function is used for returning the logarithm of n base m. The LOG function accepts two parameters which are used to calculate the logarithmic value. The LOG function returns a value of the numeric data type. This function takes as an argument any numeric data type as well as any non-nu 2 min read PLSQL | LN Function The LN function is an inbuilt function in PLSQL which is used to return the natural logarithm of a given input number. The natural logarithm of a number is the logarithm of that number to the base e, where e is the mathematical constant approximately equal to 2.718. This is written using the notatio 2 min read PLSQL | LTRIM Function The PLSQL LTRIM function is used for removing all specified characters from the left-hand side of a string. The PLSQL LTRIM function accepts two parameters which are input_string and trim_string. If the user does not specify trim_string, it defaults to a single blank. If char is a character literal, 2 min read MOD() Function in MySQL The MOD() function in MySQL is used to find the remainder of one number divided by another. The MOD() function returns the remainder of dividend divided by divisor. if the divisor is zero, it returns NULL. Syntax: MOD(N, M) or N % M or N MOD M Parameter : MOD() function accepts two parameter as ment 4 min read PL/SQL Functions PL/SQL functions are reusable blocks of code that can be used to perform specific tasks. They are similar to procedures but must always return a value. A function in PL/SQL contains:Function Header: The function header includes the function name and an optional parameter list. It is the first part o 4 min read Like