如何只显示此查询的最高/最高百分比?
select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc
例如,这是从查询收到的数据:
我希望在此查询的HTML网页上显示的是:
答案 0 :(得分:2)
select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc LIMIT 1;