Log10() 是 MySQL 的数学函数。此函数用于获取给定数字的以 10 为底的对数。
语法
select log10(number);
参数:
number: 给定的数字。
返回
此函数返回数字的以 10 为底的对数。如果数字小于或等于 0,此函数将返回 NULL。
示例 1
Select log10(11);
输出:
mysql> Select log10(11);
+--------------------+
| log10(11) |
+--------------------+
| 1.0413926851582251 |
+--------------------+
1 row in set (0.01 sec)
+--------------------+
| log10(11) |
+--------------------+
| 1.0413926851582251 |
+--------------------+
1 row in set (0.01 sec)
示例 2
Select log10(11.5);
输出:
mysql> Select log10(11.5);
+--------------------+
| log10(11.5) |
+--------------------+
| 1.0606978403536116 |
+--------------------+
1 row in set (0.00 sec)
+--------------------+
| log10(11.5) |
+--------------------+
| 1.0606978403536116 |
+--------------------+
1 row in set (0.00 sec)
示例 3
Select log10(45.55);
输出:
mysql> Select log10(45.55);
+-------------------+
| log10(45.55) |
+-------------------+
| 1.658488381309017 |
+-------------------+
1 row in set (0.00 sec)
+-------------------+
| log10(45.55) |
+-------------------+
| 1.658488381309017 |
+-------------------+
1 row in set (0.00 sec)