SIGN

 

The function SIGN returns the sign for the numeric expression. It returns a value of -1 for negative expressions, a value of 0 for zero expressions and a value of +1 for positive expressions. If the expression is NULL then the return value is also NULL.

SQL Syntax:
 
   SIGN( number )
Number:
 
  Any numeric expression.
Escape Syntax:
 
  {fn SIGN( number )}
Return Type:
 
  INT
     

Examples:

  • SELECT SIGN(4), {fn sign(-2.3)}

    Returns: 1, -1

see also:
SQL Numeric Functions
ABS


100% pure Java DBMS
Mirror Site