Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ID username score 4 | x | 7 7 | y | 3 9 | z | 6
我想从 MySQL 中了解 y 在记分牌上的位置(即 3.)。我找不到真正的 MySQL 查询,你能帮帮我吗?
SELECT * FROM (SELECT @rank := @rank + 1 AS rank, id,username, score FROM table , (SELECT @rank := 0) r ORDER BY score ) k WHERE k.username = 'y'