LOG
returns the natural logarithm of the specified value.
The base of the logarithm can be changed starting with SQL Server 2012.
This example returns the natural logarithm of the specified value.
SELECT LOG(10) AS Ln
Ln |
---|
2.30258509299405 |
Syntax of the LOG function.
LOG(value [,base])
value
-- a value greater than 0.
base
-- optional. Sets the base of the logarithm. Must be greater than 1.
SELECT LOG(8, 4) AS 'Log 8 base 4'
Log 8 base 4 |
---|
1.5 |