I am having a lot of trouble finding any documentation on executing a simple MySQL query that will return all distinct values from a combination, but also return another column that is not distinct.
In my case report, topic, lat, lng, event
must be the distinct combination of values, but I also want to return the docID
column.
If I include docID
as a distinct value, it returns every document, because each docID
is unique.
SELECT distinct
report, topic, lat, lng, event, /*and each of their*/ docID FROM reports
I know this question is really simple, but I just can't find any documentation about it.