SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual523725-004
9-142
SIGN Function
SIGN Function
The SIGN function returns an indicator of the sign of a numeric value expression. If the
value is less than zero, the function returns -1 as the indicator. If the value is zero, the
function returns 0. If the value is greater than zero, the function returns 1.
SIGN is an SQL/MX extension.
numeric-expression
is an SQL numeric value expression that specifies the value for the argument of
the SIGN function. See Numeric Value Expressions on page 6-50.
Examples of SIGN
Return the value –1:
SIGN (-20 + 12)
Return the value 0:
SIGN (-20 + 20)
Return the value 1:
SIGN (-20 + 22)
SIGN (numeric-expression)