SIGN: return a -1 if the number is negative, +1 if the number is positive, or 0 if the number is 0 : SIGN « Math Functions « SQL Server / T-SQL






SIGN: return a -1 if the number is negative, +1 if the number is positive, or 0 if the number is 0

2> -- SIGN: return a -1 if the number is negative, +1 if the number is positive, or 0 if the number is 0.
3>
4> SELECT SIGN(-23)
5> GO

-----------
         -1

(1 rows affected)


           
       








Related examples in the same category