LN() will return the exponential value of its argument, which is recognized as the input parameter's natural logarithm.
The logarithm doesn’t take negative numbers or 0.
The syntax of the LN() function is described as follows.
x: A positive or a negative number (or an expression that evaluates to a number).
The example below shows that LN() function will return the natural logarithm of the number 7,87653.
The final result is as follows.
In the following example, we will combine LN() function with CREATE TABLE query. Therefore we can obtain natural logarithmic values of a specific column.
1) Create a new table named LNTable containing the initValue column with an integer value.
2) Run the following query to get the logarithm output of the column:
3) It will return the initial value with its natural logarithm value.
- initValue column with the initial integer values.
- lnValue column with the natural logarithm values.