The LOG function returns the logarithm of y to the base of x.
Syntax
LOG (x,y)
Parameters
| Parameter | Description |
|---|---|
| x,y | The expression of the numeric types: NUMBER, FLOAT, BINARY_FLOAT, and BINARY_DOUBLE. x and y must be greater than 0. |
Return type
If the data types of the parameters are BINARY_FLOAT and BINARY_DOUBLE, the return type is BINARY_DOUBLE. In other cases, the return type is NUMBER.
Examples
This example shows the logarithm of 8 to the base of 2.
SELECT LOG(2,8) FROM DUAL;
The following query result is returned:
+----------+
| LOG(2,8) |
+----------+
| 3 |
+----------+