![]() Most SQL database servers throw errors when attempting to find MOD of an integer value and zero, whereas database servers such as Oracle returns the first argument or dividend. This is because MOD performs repeated subtraction and reaches the desired remainder. MOD returns remainder even when we divide floating point or double data type values. ![]() The given query returns the remainder obtained by dividing 98 by 3, i.e 2. ![]() When we divide 20 by 2, we get a remainder of 0 since 20 is completely divisible by 2. SQL queries to illustrate basic functionality of SQL MOD() function. Here are a few simple queries to illustrate the use of SQL MOD() function in different scenarios, such as completely divisible arguments, floating-point, and double data types, negative numbers, etc. MOD() function can be used as a part of any SQL statement or clause that takes expressions, such as SELECT, WHERE, HAVING, etc. It is the divisor in classical mathematics.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |