select articleid,count(*) as zongshu from table where typeid in ('评论','留言') group by articleid order by zongshu desc;