HI,
I actually posted similar (or same?) question yesterday, but I thought I need to post a new question since I have short, but clear question.
I have the f
In mysql 8 you can use window function like:
SELECT id, score, rank() over (order by amount) as ranking FROM SomeTable
If you need to select only one row, use a subquery:
SELECT id score, ranking FROM ( SELECT id, score, rank() over (order by score) as ranking FROM SomeTable ) t WHERE id = ?