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 PLSQL | NCHR Function The PLSQL NCHR function is used for returning the character based on the number code in the national character set or in other words it returns the binary equivalent to the number in the national character set. The value returned by the NCHR function is always of the datatype NVARCHAR2. The NCHR fun 1 min read PLSQL | LEAST Function The LEAST is an inbuilt function in PLSQL which is used to return the least value from a given list of some expressions. These expressions may be numbers, alphabets etc. Syntax: LEAST(exp1, exp2, ... exp_n) Parameters Used: This function accept some parameters like exp1, exp2, ... exp_n. These each 2 min read PLSQL | ABS Function The PLSQL ABS function is used for returning the absolute value of a number. Absolute value is used for depicting the distance of a number on the number line from 0. The direction of the number from zero is not considered since the absolute value of a number is never negative. The ABS in PLSQL funct 2 min read MID() function in MySQL MID() : This function in MySQL is used to extract a substring from a given input string. If the starting position is a positive number, then the substring of the given length will be extracted from the starting index. If negative, then the substring of the given length will be extracted from the end 2 min read PLSQL | SQRT Function In PL/SQL, the SQRT function is used to find the square root of a number. This function is really handy for various tasks that involve mathematical calculations, such as analyzing statistics, solving geometry problems, or handling financial data. The SQRT function is easy to use and can simplify com 4 min read Like