Mysql select query count until reach the condition with condition
问题 I have lists of users with his points and game id. I need to find the rank of the specified user based on the game order by the max(lb_point). I have already done the query for getting the rank based on individual game as follows. select count(*) AS user_rank from ( select distinct user_id from leader_board where lb_point >= (select max( lb_point ) from leader_board where user_id = 1 and game_id = 2 ) and game_id = 2 ) t But i need to find the rank based on the overall game. Example i have 3