नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime 15.3 and above
Returns the remainder after dividend / divisor or NULL ifdivisor is 0.
Syntax
try_mod(dividend, divisor)
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.
Examples
> SELECT try_mod(2, 1.8);
0.2
> SELECT try_mod(2, 0);
NULL