SQL Server/T-SQL Tutorial/Math Functions/ABS

Материал из SQL эксперт
Перейти к: навигация, поиск

ABS function returns the absolute value of any number passed to it.

   <source lang="sql">

4> 5> SELECT SQRT(2.0*ABS(2000.0)*ABS(-8.0)/ABS(0.20)) 6> GO


                    400

(1 rows affected)</source>


select ABS(-1.25)

   <source lang="sql">

4> select ABS(-1.25) 5> GO


1.25

(1 rows affected)</source>