try_mod
function
Applies to: Databricks SQL Databricks Runtime 15.3 and later
Returns the remainder after dividend / divisor
or NULL
if`divisor` is 0
.
Arguments
dividend
: An expression that evaluates to a numeric.divisor
: An expression that evaluates to a numeric.
Returns
If both dividend
and divisor
are of DECIMAL
, the result matches the divisor’s type.
In all other cases, a DOUBLE
.
If divisor
is 0, the function returns NULL
. To raise DIVIDE_BY_ZERO error instead use the mod() function.