MySQL LOG10 function is one of the Mathematical Function, which is used to return the base 10 logarithmic value of a given number.
In this article, we will show you, How to find base 10 logarithmic values in MySQL using Command Prompt, and Workbench with examples.
MySQL LOG10 Syntax
The basic syntax of the LOG10 in MySQL is as shown below:
SELECT LOG10(x) FROM Source
MySQL LOG10 Function Example 1
The LOG10 Function is used to return the base 10 logarithmic value of any numeric value. The following query shows you multiple ways to use LOG10 function.
SELECT LOG10(78930), LOG10(-20);
MySQL LOG10 Example 2
The MySQL LOG10 Function also allows you to find and return the base 10 logarithmic value of a column data.
In this example, we are going to find the base 10 logarithmic values for all the records present in Sales Amount, Standard Cost and Tax Amount columns.
LOG10( StandardCost) AS Log10StdCost,
LOG10( SalesAmount) AS Log10SalesAmount,
LOG10( TaxAmt) AS Log10TaxAmt
FROM `MySQL Tutorial`.`mathemetical functions`;
Thank You for Visiting Our Blog