I know that I can limit a query by 10 for instance, and have the top rows returned, but I have a situation where I want to return all rows, but I want to be able to mark the rows that fall in the top 10 a certain way.
For instance, let's say we have the following tables
table: fruit
id int 11
name vchar 100
table: persons
id int 11
name vchar 100
table: owned_fruit
id int 11
fruit_id int 11
person_id int 11
I want to show a listing using the owned fruit table, show a count grouped by friend, but also highlight the fruit that is most popular while sorting alphabetically.
I'm just not sure what the best way to go about this is.
Any help much appreciated