
要使objectId数量最多的排在最前面
select objectId,count(*) as statisticNum from statistic group by objectId order by statisticNum desc
查询结果

详细用法可以参加冯岩的博客http://www.cnblogs.com/eflylab/archive/2007/07/12/815295.html
w3Shool:http://www.w3school.com.cn/sql/sql_groupby.asp

浙公网安备 33010602011771号