SQL Server/T-SQL/Math Functions/SIGN

Материал из SQL эксперт
Версия от 13:20, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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

   <source lang="sql">

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)


      </source>