Oracle Numeric Function

Numeric Function

Overview

  •  

Numeric Function

Basic Arithmetic Functions

1. ABS()  :- 

  • Purpose: Returns the absolute (positive) value of a number.
  • Syntax: ABS(number)
  • Example :- select abs(-250) as result from dual;

Basic Arithmetic Functions

2. MOD :- 

  • Purpose: Returns the remainder of a division operation.
  • Syntax: MOD(number1, number2)
  • Example :- select mod (24,5) as result from dual;

Basic Arithmetic Functions

3. POWER  :- 

  • Purpose: Raises a number to the power of a specified value.
  • Syntax: POWER(base, exponent)
  • Example :- select power(5,3) as result from dual;

Basic Arithmetic Functions

4. ROUND :- 

  • Purpose: Rounds a number to the specified number of decimal places.
  • Syntax: ROUND(number, decimal_places)
  • Example :- select round (125.555,2) as result from dual;

Basic Arithmetic Functions

5.  TRUNC :-  

  • Purpose:  Truncates a number to the specified number of decimal places without rounding.
  • Syntax: TRUNC(number, decimal_places)
  • Example :- 

Basic Arithmetic Functions

6. CEIL :- 

  • Purpose: Returns the smallest integer greater than or equal to a number.
  • Syntax: CEIL(number)
  • Example :- select ceil (125.2) as result from dual;

Basic Arithmetic Functions

7. FLOOR  :- 

  • Purpose: Returns the largest integer less than or equal to a number.
  • Syntax: FLOOR(number)
  • Example :-  select floor (125.2) as result from dual;

Basic Arithmetic Functions

8. SQRT :- 

  • Purpose: Returns the square root of a number.
  • Syntax: SQRT(number)
  • Example :-  select length(‘WELCOME TO ORACLE 10G’) as result from dual;

Basic Arithmetic Functions

9.  EXP :- 

  • Purpose: Returns e raised to the power of the specified number (e ≈ 2.718)..
  • Syntax: EXP(number)
  • Example :- select exp(2) as result from dual;

Basic Arithmetic Functions

10. LOG 

  • Purpose:- Returns the logarithm of a number to a specified base.
  • Syntax: – LOG(base, number)
  • Example :- select chr(’97’) as result from dual;

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.