56,678
社区成员
发帖
与我相关
我的任务
分享
mysql> select currentPrice from t_lonelyriver;
+--------------+
| currentPrice |
+--------------+
| 1.23456 |
| 1.26776 |
| 1.26432 |
+--------------+
3 rows in set (0.00 sec)
mysql> select avg(currentPrice),round(avg(currentPrice),2)
-> from t_lonelyriver;
+-------------------+----------------------------+
| avg(currentPrice) | round(avg(currentPrice),2) |
+-------------------+----------------------------+
| 1.25554666666667 | 1.26 |
+-------------------+----------------------------+
1 row in set (0.05 sec)
mysql>
mysql> select 1.234,round(1.234,2);
+-------+----------------+
| 1.234 | round(1.234,2) |
+-------+----------------+
| 1.234 | 1.23 |
+-------+----------------+
1 row in set (0.06 sec)
mysql>