MySQL: LOG10 Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL LOG10 Function

In this guide, we will explain how to use the MySQL LOG10 function with syntax and examples.

Description

The MySQL LOG10 function returns the base-10 logarithm of a number.

Syntax

The syntax for the LOG10 function is:

LOG10( number )

Parameters or Arguments

number

The number to take the base-10 logarithm of. Must be greater than 0.

Note

  • The LOG10 function will return NULL, if number is less than or equal to 0.
  • See also the LOG function.

Applies To

The LOG10 function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0.3

Example

Let’s look at some LOG10 function examples and explore how to use the LOG10 function.

For example:

mysql> SELECT LOG10(1);
Result: 0

mysql> SELECT LOG10(2);
Result: 0.3010299956639812

mysql> SELECT LOG10(3.1);
Result: 0.4913616938342727

mysql> SELECT LOG10(0);
Result: NULL

Next Topic : Click Here

This Post Has One Comment

Leave a Reply