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.

  • number –
    This parameter hold a number which is greater than 0.

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
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.