我有以下查询:
SELECT hostVersion,CONVERT(varchar,100.0 * count(*) / tot,1) + '%' as 'Percent' FROM hostInfo,(SELECT COUNT(*) as tot FROM hostInfo) x GROUP BY hostVersion,tot
并收到以下输出:
+--------------------------------+ | hostVersion | Percent | +--------------------------------+ | 5.0.0 | 26.666666666666% | +--------------------------------+ | 5.1.0 | 73.333333333333% | +--------------------------------+
如何舍入到小数点后1位? (即26.7%和73.3%)