I have the following query:
SELECT hostVersion, CONVERT(varchar, 100.0 * count(*) / tot,1) + '%' as 'Percent' FROM hostInfo, (SELECT COUNT(*) as tot FROM hostInfo) x GROUP BY hostVersion, tot
And get the following output:
+--------------------------------+ | hostVersion | Percent | +--------------------------------+ | 5.0.0 | 26.666666666666% | +--------------------------------+ | 5.1.0 | 73.333333333333% | +--------------------------------+
How do I round to 1 decimal point? (i.e. 26.7% and 73.3%).
source share