You'reFirst of all, the join with PostTags
causes posts to count multiple times, depending on how many tags they have.
Also, you're ordering by sum(score) desc
- that's the total score of the posts. If you want to order by the # of posts, just order by count(*) desc
, like this query.