Select record from each mysql category

Asked

Viewed 46 times

0

How do I get the two records with the highest view of each category? I have 7 categories and would like to pick up the two items with higher views of each of these 7 categories.

  • Sort by view, if necessary group the categories, Order by view goes down

  • The sort I know how to do, but how do I query and get the two items from each category? And of course, if there is more than one item in each category, because I can only have one entry in category A and 15 in category B. You will have to return a record in category A and two in category B.

  • take the two largest , by category. This view comes in each line along with the category

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.