-1 for negative values, 0 for zero, and 1 for positive values.
Syntax
Parameters
Return Type
Same type as the input<value>.
Remarks
SIGN(NULL)returnsNULL.SIGN('NaN'::DOUBLE PRECISION)returns0, matching PostgreSQL semantics —NaNis neither positive nor negative.SIGN('Infinity'::DOUBLE PRECISION)returns1.SIGN('-Infinity'::DOUBLE PRECISION)returns-1.
Example
The following example returns the sign of several values:Rows: 1Execution time: 2.30ms