I would to do something such as:
SELECT Position INTO lastPosition FROM ranking
ORDER BY ranking.Time DESC ranking.Position DESC LIMIT 1;
but i get this error:
and:
and:
The goal is to select last row (limit 1) of ranking
ordered by descendent position
and ascendent
time.
Update
The problem was a missing comma after the first DESC, the correct statement is
SELECT Position INTO lastPosition FROM ranking
ORDER BY ranking.Time DESC, ranking.Position DESC LIMIT 1;
as noticed @Solarflare.