I am trying to figure out how to get the best users in each category using the mysql query: The My Users table looks like this:
user_id, category_id ... and some other things
My vote table looks like this (each line is one positive vote): reciever_id ... and some other things
I thought that I need to first determine the unique voices of user_id as follows:
reciever_id, votes
1 2
2 6
Then I could order this by the number of votes ... Then select users.whatever, distinct (category_id) from users (this query) WHERE users_id = that_queries_user.id
In any case, I'm probably clearly confused about how to write this request, and any help would be greatly appreciated.