mysql - Quick SQL question! Sort by most occurences of an attribute -
Item ID - Name - Category ID - DCC - Price
I want a query that lists the categories sorted by most events in the items table
This should do the trick:
SELECT c.ID, C.Name, count (i.id) FROM CROM order CID order by group C at the LEFT JOIN item i (c.ID = i.CategoryID) group By counting (id)
Comments
Post a Comment