Good morning, I have a query that makes a sum of a score according to user and then orders them from highest to lowest:
select distinct usuario as u, (select sum(puntajeProde) from prodeApuesta
where usuario = u) as total
from prodeApuesta order by total desc
How can I do to add an autoincrementable id to the query in order to obtain the position where the user was left, eg:
Juan 30 Leo 20 Maria 10
Leo's position is 2