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 |
---|---|
|
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. |
|
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
orExpression2
is of typeNUMBER
, the data type returned isNUMBER
. For all other numeric data types, the data type returned isBINARY_DOUBLE
. -
If the value of
Expression1
orExpression2
NULL
, or if bothExpression1
andExpression2
areNULL
,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.