Returns the remainder when the the first argument (the dividend is divided by the second numeric argument (the divisor). If the divisor is zero, a divide by zero error is raised.
MOD ( < - dividend>, < - divisor> )
<dividend> := < - integer-expression>
<divisor> Â := < - integer-expression>
Function | Result |
---|---|
MOD(4,2) | 0 |
MOD(5,3) | 2 |
MOD(-4,3) | -1 |
MOD(5,12) | 5 |
The SQLstream MOD function only supports arguments of scale 0 (integers). This is a departure from the SQL standard, which supports any numeric argument. Other numeric arguments can be CAST to an integer, of course.