I have a database table with a users id and shoe.
For each shoe a user gets an row in the db so a person with the id 5 might have 50 entries, a user id of 3 might have 23 entries and so on.
Im wondering how i would display the top 10 user ids based on the amount of shoes they have in the db?
Your SQL code should resemble this:
The key is the
GROUP BYinstruction, it tells MySQL to roll all the same user ID’s into one entity.