从DB找到最佳贡献者

CLi*_*own 1 php mysql

在我的站点上创建的每个帖子都存储在数据库表中,该表中的列是列出用户用户名的列.

我想找到我网站的前10位贡献者,我如何计算所有用户创建的所有帖子,然后在列表中显示前10位贡献者.

表名:帖子表列:用户名

每个帖子都有一个用户名条目.

Jon*_*and 6

 SELECT count(username) a,username from posts group by username order by a desc limit 10
Run Code Online (Sandbox Code Playgroud)