I am trying to get a list of the top 10 items viewed solutions in my knowledge base. I do this by getting the count of records in the solution_rating__c table joined to the solution table record which has the KB article. The solution_rating table gets a new insert every time the article is viewed. So I tried to put together the query below, but can't figure out how to get the results to sort by the aggregate count of soltuion_ratings for each solution record.
select top 10 count(sr.solution__c ) as thecount, sr.solution__c ,
from dbo.solution_rating__c sr
join solution s on sr.solution__c = s.id
left outer join dbo.product_group__c p
on s.product_group__c = p.id
group by thecount, sr.solution__c ,s.solutionname, p.[name]