Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

SIGN Function

The SIGN function returns the sign (positive or negative) of a numeric value. The result of the SIGN function will be a 1, -1, or 0 indicating the sign of the argument.

Syntax

Copy
SIGN (numeric)

Argument

numeric

Numeric value to be evaluated.

Return Type

Integer

Examples

Determine the sign of the commission paid for a given transaction:

Copy
select commission, sign (commission) from sales where salesid=10000; commission | sign -----------+------ 28.05 | 1 (1 row)