December 12th, 2008
LN (natural logarithm)
Posted by
admin in
H. ANSI Numeric Scalar Functions
The LN function returns the natural logarithm of a number, which is the power to which you would need to raise the constant e (approximately 2.718281828…) in order to get the result.
Format:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â LN(expression)
Example: SELECT LN(2.718281) FROM TABLEA;
Result:
                   ![]()
> DB2, Oracle, and PostgreSQL support the LN function.
> DB2 and PostgreSQL also support LOG as a synonym.
> MySQL and SQL Server only support the non-standard LOG function.
> Use the EXP function to reverse the process.
Â