Here is my query I am working with.
SELECT
DISTINCT Roster.RosterID AS RosterID
FROM Roster
INNER JOIN Photos ON Roster.RosterID = Photos.RosterID
INNER JOIN Users ON Photos.UserID = Users.UserID
INNER JOIN Roads ON Roads.RoadID = Roster.RoadID
ORDER BY Photos.PhotoID DESC
LIMIT 200
This query will not work right now because it is missing this:
, Photos.PhotoID AS PhotoID
When I add this to make it work, the results from the query are no longer the same. It thinks now I want the distinct values from both RosterID as well as PhotoID.
Is there a way to get a DISTINCT list of RosterID's ordered by PhotoID without putting PhotoID in the results?
Thanks for your help!!!