The LOG10 SQL Function in MySQL and MariaDB - Logarithm to the base 10
The LOG10() function returns the logarithm based on 10 of "Number".
If the value of Number is less than or equal to 0, NULL is returned.
If "Number" is NULL, the LOG10() function returns NULL.
SQL Examples for the LOG10 function
1 2 3 4 5
selectlog10(2.4) as result;selectlog10(2) as result;selectlog10(-2) as result;
The examples were created with the MyWAY SQL manager: Download
How to use the LOG10() function in MySQL and MariaDB databases
The LOG10() function in MySQL and MariaDB is used when there is a need to calculate base 10 logarithms, for example when working with logarithmic scales or analyzing data that follow a base 10 logarithmic relationship. The function uses floating-point arithmetic, so the precision of the result depends on the underlying data type.