MySQL log()函数

LOG(X)

LOG(B,X)

该函数的单个参数版本将返回X的自然对数,如果调用两个参数,它返回X的对数的任意基数B.请看下面的例子:

mysql>SELECT LOG(45);
+---------------------------------------------------------+
| LOG(45)                                                 |
+---------------------------------------------------------+
| 3.806662                                                |
+---------------------------------------------------------+
1 row in set (0.00 sec)

mysql>SELECT LOG(2,65536);
+---------------------------------------------------------+
| LOG(2,65536)                                            |
+---------------------------------------------------------+
| 16.000000                                               |
+---------------------------------------------------------+
1 row in set (0.00 sec)

    点赞