I'm working on a reporting software. I'm using MySQL as its Database backend. In the database there's a column called "location". The location column has a lot of values and I want to display the top 5 locations that have the maximum entries.
For eg. there are 500 entries. Out of which, 100 are from Delhi, 150 from Mumbai, 80 from Jaipur, 60 from Hyderabad and so on. Now, I want to create a table of "Top Locations".
I have tried "select * from table_name limit 5" but this returns the last 5 entries.
Is there any method I'm missing?