I’d like to get some sort of Top Ten list from a table a MySQL database.
Here’s an example. Let’s say I have this table:
ID Username Town
1 foo Munich
2 bar Kolding
3 herp Bordeaux
4 derp Bordeaux
5 test Cologne
6 bla Munich
7 blob Bordeaux
And now, I’d like to get the most common entries in ‘Town’, like this:
Bordeaux 3
Munich 2
Cologne 1
Kolding 1
What kind of query can do that?
How about this.
If you want only 10 records, use