All Products
Search
Document Center

MaxCompute:NEGATIVE

Last Updated:Sep 16, 2026

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 input expression. The value can be of the TINYINT, SMALLINT, INT, BIGINT, DOUBLE, or DECIMAL type.

Return value

Returns the negative value of the expr expression.

Examples

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

Related functions

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