MySQL LOG10 Function

MySQL LOG10 function is one of the Mathematical functions which is useful to return the base 10 logarithmic value of a given number. Let us see how to find base 10 logarithmic values using Command Prompt and Workbench with examples.

The basic syntax of the MySQL LOG10 function is as shown below:


MySQL LOG10 Function Example

The LOG10 function returns the base 10 logarithmic value of any numeric value. The following query shows you multiple ways to use this.

SELECT LOG10(100);

SELECT LOG10(1230);

SELECT LOG10(78930), LOG10(-20);
LOG10 Example 1

This method also allows you to find and return the base 10 logarithmic value of column data. In this Mathematical method example, we are going to find the base 10 logarithmic values for all the MySQL records present in Sales Amount, Standard Cost, and Tax Amount columns.

SELECT EnglishProductName, 
       LOG10( StandardCost) AS Log10StdCost,
       LOG10( SalesAmount) AS Log10SalesAmount,
       LOG10( TaxAmt) AS Log10TaxAmt
  FROM `mathemetical functions`;
MySQL LOG10 Function 2