Saturday, September 14, 2013

Item popularity in mysql

Item popularity in mysql

I have a table
ItemId Items views
1 - item1 - 4
2 - item2 - 3
3 - item3 - 3
I would live to know how populair a product is
the result should be
item 1: first place
item 2: second place
item 3: second place
I have a very hard time figuring out how to do this in mysql. Is there a
query that will to exactly this ? Especially when a user is on the item3
page I would like to say: this is the second most popular product
Any help would greatly appreciated !

No comments:

Post a Comment