mysql avg(currentPrice)如何取两位小数。 mysql avg(currentPrice)如何取两位小数。currentPrice 字段是varchar(8)。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 round 一下应该就可以了。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> 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存储过程返回多个记录 谁能给推荐两本学基础的书。 请教..关于一条SQL语句 大家好,我想问一下MYSQL中WITH AS怎么用阿? 两表的数据,合成一表 insert 语句中values(not_sque.nextVal)是什么意思? 各位前辈请帮忙,UUID!~ dbtools和EMSMYSQL manager哪个更好用,或者有其他更好的给我推荐以下 xampp中的mysql数据库怎么用控制台操作么 Mysql mysql 存储过程 alter table传参数问题 access某字段数据内容导入到mysql某字段?
+-------+----------------+
| 1.234 | round(1.234,2) |
+-------+----------------+
| 1.234 | 1.23 |
+-------+----------------+
1 row in set (0.06 sec)mysql>
+--------------+
| 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>