SELECT * FROM (SELECT user_id,(@rowNum:=@rowNum+1) AS rowNo FROM tab_users,(SELECT (@rowNum :=0) ) b ORDER BY age DESC) c WHERE user_id=216;