Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

SIGN

Example

Determine and return the sign of a number.

SELECT SIGN(255.5);

Definition and Usage

The SIGN() function indicates the sign of a number, returning:

  • 1 if the number is positive
  • 0 if the number is zero
  • -1 if the number is negative

Syntax

SIGN(number)

Parameter Values

Parameter

Description

number

Required: The number for which to determine the sign.

Technical Details

Works in:

SQL Server (beginning from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse

More Examples

Example

Determine and return the sign of a given number.

SELECT SIGN(-12);