HI,
This should be easy but I don't understand enough about how grouping works.
Basically I have 2 tables "Categories" and "Items"
Categories
ID
CategoryName
Items
ID
CategoryID
ItemName
Photo
Score
All I want to do is get 1 row for each category which contains the Category ID, the Category Name and the photo that belongs to the highest scoring item.
So I have tried joining the categories to the items and grouping by the CategoryID. Trouble is that I want to order the items so that the highest scoring items are at the top before it does the groupings to make sure that the photo is from the current highest scoring item in that category. If I select MAX(I.score) I can get the highest score but I'm not sure how to get accompanying photo as MAX(photo) will obviously give me the photo with the highest file name alphabetically.
I hope I've explained that well.