SELECT user.userid , user.username , counts.comments FROM ( SELECT userid , COUNT(*) AS comments FROM reputation WHERE reason IS NOT NULL GROUP BY userid ) AS counts INNER JOIN user ON user.userid = counts.userid ORDER BY counts.comments DESC LIMIT 10;