ABS ()
- It returns absolute value of the given values.
- Syntax:
ABS (Val);
SELECT abs (-15) FROM DUAL ;
15
Power ()
- It returns power of Mn where m is the value for which power of the n will returns.
- Syntax:
power (m, n) ;
SELECT power (4, 2 )FROM DUAL ;
16
Sqrt ()
- It return square root of the given value.
- Syntax:
sqrt (Val);
SELECT sqrt (25) FROM DUAL ;
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);
SELECT sign (25) FROM DUAL ;
1
Ceil ()
- It returns smallest integer value which greater than or equal to specified value.
- Syntax:
ceil (Val, precision);
SELECT ceil (10.591, 2) FROM DUAL ;
10.60
Floor ()
- It returns smallest integer value which is less than or equal to specified value.
- Syntax:
floor (value, precision );
SELECT floor (10.43,2) FROM DUAL ;
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 ) ;
SELECT round (15.45,1) FROM DUAL ;
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 ;
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 ) ;
SELECT trunc (15.45, 1) FROM DUAL ;
15.4
SELECT trunc (15.45, -1) FROM DUAL ;
10