这是目前获取所有用户排名的MySQL查询。但我想获取特定的用户排名。
SELECT Percentage_of_Marks,mark,test_id,
1+(SELECT count(*) from user_test a
WHERE a.Percentage_of_Marks > b.Percentage_of_Marks) as RNK,
Percentage_of_Marks
FROM user_test b
ORDER BY b.Percentage_of_Marks DESC
我的查询结果是。
如何查找特定test_id的RNK。
答案 0 :(得分:0)
-g