LOG Function in Oracle SQL – PLSQL

The LOG function in Oracle SQL / PLSQL is used to return the logarithmic value of a number to a base.

Syntax for the LOG function in Oracle SQL / PLSQL is:

SELECT LOG(n,m)
FROM table_name;

  • ‘n’ must be a positive number
  • ‘m’ must be a positive number except 0 and 1.

Example 1:

SELECT LOG(20,10)
FROM DUAL; 

Will return “0.768621786840241”


Example 2:

SELECT LOG(20,20)
FROM DUAL; 

Will return “1”


Tagged , , , , , , , , , , , . Bookmark the permalink.