ABS ()

  • It returns absolute value of the given values.
  • Syntax:
ABS (Val);
  • Example:
SELECT abs (-15) FROM DUAL ;
  • Output:
15

Power ()

  • It returns power of Mn where m is the value for which power of the n will returns.
  • Syntax:
power (m, n) ;
  • Example:
SELECT power (4, 2 )FROM DUAL ;
  • Output:
16

Sqrt ()

  • It return square root of the given value.
  • Syntax:
sqrt (Val);
  • Example:-
SELECT sqrt (25) FROM DUAL ;
  • Output:-
5

Sign ()

  • It returns sign of the specified values.
  • It returns 1 if value is positive, -1 if value is negative, and 0 if value is zero.
  • Syntax:
sign (Val);
  • Example:
SELECT sign (25) FROM DUAL ;
  • Output:
1

Ceil ()

  • It returns smallest integer value which greater than or equal to specified value.
  • Syntax:
ceil (Val, precision);
  • Example:
SELECT ceil (10.591, 2) FROM DUAL ;
  • Output:
10.60

Floor ()

  • It returns smallest integer value which is less than or equal to specified value.
  • Syntax:
floor (value, precision );
  • Example:
SELECT floor (10.43,2) FROM DUAL ;
  • Output:
10

Round ()

  • It returns rounding value up to specified digit.
  • If no precision is specified then it will round value up to the zero digits.
  • Syntax:
round (val, precision ) ;
  • Example:
SELECT round (15.45,1) FROM DUAL ;
  • Output:
15.5
  • We can also specified precision in negative.
  • When precision is specified in negative than it will round the given value at the left side.
  • Example:
SELECT round (15.45, -1) FROM DUAL ;
  • Output:
45

Trunc ()

  • It returns specified value truncating up to the specified precision.
  • If precision is given in negative then it will truncate from the left.
  • Syntax:
trunc (val , precision ) ;
  • Example:
SELECT trunc (15.45, 1) FROM DUAL ;  
  • Output:
15.4
  • Example:
SELECT trunc (15.45, -1) FROM DUAL ;  
  • Output:
10