Returns the sign of a numeric value.

Syntax

SIGN(expression)

Arguments

expression: a numeric expression of type DOUBLE.

Returns

  • An INTEGER value.

    • NULL when expression is NULL.

    • Returns zero when expression is zero.

    • Positive one when expression is positive

    • Negative one when expression is negative.

Examples

SELECT numberCol, SIGN(numberCol) AS numberColSIGN FROM MYSQL.inventory.cust;

-- SIGN(-5.74);
-- Returns -1

-- SIGN(27.2);
-- Returns 1