MOD
Description
The MOD function is used to calculate the remainder of the division of two numeric expressions. This function supports various data types, including integers and decimals.
Supported Parameter Types
- expr1: Supported data types include float, double, decimal, tinyint, smallint, int, bigint.
- expr2: Same type as expr1.
Return Result
The return type is the same as the input parameter type.
Usage Example
Notes
- When expr2 is 0, the result of the MOD function is undefined and may cause errors or exceptions.
- The result of the MOD function may be negative, depending on the signs of expr1 and expr2. If you need to ensure the result is positive, you can use the ABS function to process the result.
With the above examples and explanations, you can better understand and use the MOD function to handle your data calculation needs.