All Products
Search
Document Center

MaxCompute:NEGATIVE

Last Updated:Mar 26, 2026

Returns the negated value of a numeric expression.

Syntax

negative(<expr>)

Parameters

expr: required. The input numeric expression. Supported types: TINYINT, SMALLINT, INT, BIGINT, DOUBLE, or DECIMAL.

Return value

Returns the negated value of expr. The return type is the same as the input type.

Examples

SELECT negative(1);
-- Output: -1

Related functions

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