नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime
Returns the negated value of expr. This function is a synonym for - (minus sign) unary operator.
Syntax
negative(expr)
Arguments
expr: An expression that evaluates to a numeric or interval.
Returns
The result type matches the argument type.
For integral numeric types the function can return an ARITHMETIC_OVERFLOW error.
Warning
In Databricks Runtime, if spark.sql.ansi.enabled is false, an overflow does not cause an error but “wraps” the result instead.
Examples
> SELECT negative(1);
-1
> SELECT negative(cast(-32768 AS smallint))
Error: ARITHMETIC_OVERFLOW