LOG

The LOG function returns the logarithm, base Expression2, of Expression1. The base Expression2 can be any positive value other than 0 or 1 and Expression1 can be any positive value.

SQL syntax

LOG(Expression1,Expression2)

Parameters

LN has the parameter:

Parameter Description

Expression1

Operand or column can be any numeric data type or any non-numeric data type that can be implicitly converted to a numeric data type.

Expression2

Operand or column can be any numeric data type or any non-numeric data type that can be implicitly converted to a numeric data type.

Description

  • If Expression1 or Expression2 is of type NUMBER, the data type returned is NUMBER. For all other numeric data types, the data type returned is BINARY_DOUBLE.

  • If the value of Expression1 or Expression2 is NULL, or if both Expression1 and Expression2 are NULL, NULL is returned.

Example

Use the LOG function to return the natural logarithm of 100.

Command> SELECT LOG(10,100) "Log base 10 of 100" FROM dual;
< 2 >
1 row found.