i have the similar problem mentioned in this thead
but it's in SQL server and Mysql doesn't support "Partition By" as i know now what can i do? Here is the Question:
I have a table that has some columns: User, Category, Value
And I want to make a query that will give me a ranking, of all the users by the value, but reset for the category.
Example:
user1 CategoryA 10
user2 CategoryA 11
user3 CategoryA 9
user4 CategoryB 3
user1 CategoryB 11
the query would return:
Rank User Category
1 user2 CategoryA
2 user1 CategoryA
3 user3 CategoryA
1 user1 CategoryB
2 user4 CategoryB
Any ideas?