All Products
Search
Document Center

MaxCompute:NEGATIVE

Last Updated:Jul 24, 2023

Returns the negative value of an expression.

Syntax

TINYINT|SMALLINT|INT|BIGINT|DOUBLE|DECIMAL negative(TINYINT|SMALLINT|INT|BIGINT|DOUBLE|DECIMAL <expr>)

Parameters

expr: required. The value is an expression of the TINYINT, SMALLINT, INT, BIGINT, DOUBLE, or DECIMAL type.

Return value

The negative value of expr is returned.

Examples

-- The value 1 is returned. 
SELECT negative(1);

Related functions

NEGATIVE is a mathematical function. For more information about functions related to data computing and conversion, see Mathematical functions.