EXP Function in Oracle SQL – PLSQL

Oracle SQL /PLSQL uses the EXP (exponential) function to return ‘e’ raised to the nth power, where e = 2.71828182845905.

Oracle SQL / PLSQL syntax for the EXP function is:

SELECT EXP(n)
FROM table_name;

  • Here ‘n’ is the power to raise e up to.

Example 1: Using Oracle SQL EXP Function with SQL SELECT Statement

SELECT EXP(1)
FROM DUAL; 

The above SQL SELECT example of EXP() Function will return “2.71828182845905” as e*1 = 2.71828182845905


Example 2: Using Oracle SQL EXP Function with SQL SELECT Statement

SELECT EXP(2)
FROM DUAL; 

The above SQL SELECT example of EXP() Function will return “7.38905609893065” as e*e = 7.38905609893065


Example 3: Using Oracle SQL EXP Function with SQL SELECT Statement

SELECT EXP(-2)
FROM DUAL; 

The above SQL SELECT example of EXP() Function will return “0.135335283236613” as 1/(e*e) = 0.135335283236613


Example 4: Using Oracle SQL EXP Function with SQL SELECT Statement

SELECT EXP(0)
FROM DUAL; 

The above SQL SELECT example of EXP Function will return “1” as anything raised to 0 is 1


Tagged , , , . Bookmark the permalink.