Open In App

LOG10() Function in SQL Server

This function returns the logarithm of a number to base 10.

Syntax :



LOG10(number)

Parameter :
This method accepts a single-parameter as mentioned above and described below.

Returns –
It returns the base-10 logarithm of the specified number.



Let’s consider the following examples.
Example-1 :

SELECT LOG10(1) Result;

Output :

Result
0

Example-2 :

SELECT LOG10(10) Result;

Output :

Result
1

Example-3 :
Return the base-10 logarithm of 10.

SELECT LOG10(10);

Output :

1.0

Example-4 :
Return the base-10 logarithm of 1.

SELECT LOG10(1);

Output :

0.0

Example-5 :
When the argument passing as an expression.

SELECT LOG10(2 * 3);

Output :

0.77815125038364363
Article Tags :
SQL