This tutorial explains how to use the MySQL LOG10 function with syntax and examples.
The MySQL LOG10 function returns the base-10 logarithm of a number.
The syntax for the LOG10 function in MySQL is:
LOG10( number )
The number to take the base-10 logarithm of. Must be greater than 0.
The LOG10 function can be used in the following versions of MySQL:
Let's look at some MySQL LOG10 function examples and explore how to use the LOG10 function in MySQL.
For example:
mysql> SELECT LOG10(1);
Output: 0
mysql> SELECT LOG10(2);
Output: 0.3010299956639812
mysql> SELECT LOG10(3.1);
Output: 0.4913616938342727
mysql> SELECT LOG10(0);
Output: NULL