Open In App

LOG() & LOG10() in SQL Server

The LOG() function could be used to calculate the natural logarithm of a specific number.

1. LOG() :



Syntax :

SELECT LOG(number);

Note : Parameter number is mandatory. The number must be greater than 0.



Example –

SELECT LOG(2);
Output –

0.69314718055994529

2. LOG10() :
The LOG10() function could be used to calculate the natural logarithm to base 10 of a specific number.

Syntax :

SELECT LOG10(number);

Note : Parameter number is mandatory. The number must be greater than 0.

Example –
SELECT LOG10(2);

Output –

0.3010299956639812
Article Tags :
SQL