只显示mysql查询的最高结果?

时间:2015-03-11 23:39:25

标签: mysql

如何只显示此查询的最高/最高百分比?

select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc

例如,这是从查询收到的数据:

enter image description here

我希望在此查询的HTML网页上显示的是:

enter image description here

1 个答案:

答案 0 :(得分:2)

MySQL Limit!

select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc LIMIT 1;