Table structure:
country
season
points
Current query:
SELECT SUM(points) AS total, country
FROM table
WHERE season >= X
GROUP BY country
ORDER BY total desc
This gives me a nice list ordered by a total points collected by a given country. BUT, if a country is tied with another country, I want to sort by their points in the latest season given, is that possible within the same query? And if so, how? (Remember its grouped at the moment)
example of rows
denmark (country), 1 (season), 10 (points)
denmark (country), 2 (season), 5 (points)
sweden(country), 1 (season), 5 (points)
sweden (country), 2 (season), 10 (points)
Maybe this’ll do your trick: