SIGN Function

Returns a number that indicates the sign of a numeric value expression.

Category: Mathematical
Returned data type: TINYINT
Note: This function is not supported on Teradata 14.0. and later.

Syntax

SIGN(expression)

Arguments

expression

specifies any valid SQL expression that evaluates to a numeric value.

Data type BIGINT, DOUBLE, FLOAT, INTEGER, REAL, SMALLINT, TINYINT
See <sql-expression>
FedSQL Expressions

Details

The SIGN function returns the following values:
-1
if expression < 0
0
if expression = 0
1
if expression > 0

Example

The following statements illustrate the SIGN function:
Statements
Results
select sign(-5);
-1
select sign(5);
1
select sign(0);
0
Last updated: February 23, 2017