Very suddenly there was a problem with a lack of knowledge in sql (mysql). There is no time to replenish them. There is a task to make a rating by the number of open cases, by the user (roulette site). Each case opening is stored in the history table and has the key of the user who opened the case. In the user table, each user is also assigned a unique key (something like id). I can easily get the COUNT () of open cases. BUT! How do I get top (10,20,30, ...) users for open cases using mysql tools? You can also send to the necessary documentation on the topic.

select ... from (select user_id, count(1) as cnt from tab group by user_id) x join users u on u.id=x.user_id- Mikeselect ... from (select user_id, count(1) as cnt from tab group by user_id) x join users u on u.id=x.user_id