Reputation: 327
How can I display only the top/largest percentage from this query?
select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc
For example this is data received from the query:
What I want displayed on an HTML page from this query is this:
Upvotes: 1
Views: 476
Reputation: 173
select round((count(*)*100)/(select count(*) from test),1) as percent from test group by field1 order by percent desc LIMIT 1;
Upvotes: 2