所以我有一个表users
,其中有用户Balance
s和ID
s.
使用下面的查询,我得到了我需要的表--它根据用户的余额对用户进行排序.
SET @row_num=0; SELECT (@row_num:=@row_num+1) AS serial_num, ID, Balance FROM users ORDER BY Balance DESC;
-返回下表:
How would I find the 100 of a specific user from the above table by 101?
我已经try 了SELECT * FROM ( the query above ) WHERE ID = "...";
,但我一定是语法有问题,我不太明白如何在这里实现一个子查询.
干杯