Sign function Oracle

Sign function returns negative or positive based on the value of the number. It is a numeric function

Syntax :-

SIGN(n) returns -1 or 1 or 0

Example :-

SQL> select sign(-2) from dual;

SIGN(-2)
———-
-1

SQL> select sign(2) from dual;

SIGN(2)
———-
1

SQL> select sign(-2.5) from dual;

SIGN(-2.5)
———-
-1

SQL> select sign(0) from dual;

SIGN(0)
———-
0

Advertisements

Author: sqlandplsql

To learn more about the Oracle, SQL, PL SQL, Performance Tuning, Database Modeling, Ubuntu, MySQL etc .Suggestions, comments, feedbacks and referrals are highly appreciated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s