PostgreSQL/Math Functions/abs

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

abs(x) absolute value

   <source lang="sql">

postgres=# -- abs(x) absolute value postgres=# postgres=# select abs(-17.4) ;

abs

17.4

(1 row) postgres=# postgres=#

      </source>
   
  


abs(x): Returns the absolute value of x

   <source lang="sql">

postgres=# postgres=# -- abs(x): Returns the absolute value of x postgres=# select abs(-100) AS abs_negative;

abs_negative

         100

(1 row) postgres=# postgres=#

      </source>