MySQL Tutorial/Math Numeric Functions/LOG10
LOG10(X) returns the base-10 logarithm of X.
mysql>
mysql> SELECT LOG10(2);
+------------------+
| LOG10(2) |
+------------------+
| 0.30102999566398 |
+------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT LOG10(100);
+------------+
| LOG10(100) |
+------------+
| 2 |
+------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT LOG10(-100);
+-------------+
| LOG10(-100) |
+-------------+
| NULL |
+-------------+
1 row in set (0.01 sec)
mysql>
LOG10(X) is equivalent to LOG(10,X).
mysql>