Jump to: navigation, search

PostgreSQL SIGN

From w3cyberlearnings

Contents

Postgresql SIGN

This function returns the sign of the argument. Negative is (-), Zero is (0), and Positive is (+).

Syntax SIGN

X is a number.

SIGN(X);

Example 1

postgres=# SELECT SIGN(-30),SIGN(30),SIGN(0);
 sign | sign | sign 
------+------+------
   -1 |    1 |    0
(1 row)



Related Links



Navigation
Web
SQL
MISC
References