So i have a table called cities with the attribute path (can have duplicate or more equal entries), name and kms, and i need to filter it so that i have entries with only one entry of each for path with the highest kms. what i have now is
SELECT cities.*
FROM cities, categories
group by cities.path , cities.kms
ORDER BY cities.kms desc
the problem is that it gives me back duplicated entries for path( wich i dont want) and also it doesnt order it by kms like i want. What should i do?
I see no purpose for the
categoriestable in your query, so I have eliminated it in my answer.