Q&A about the site for amateur radio enthusiasts
select top 10 Users.Id, Users.DisplayName, count(distinct(Comments.Id)) as CommentCount --count(distinct(Posts.Id)) PostCount from Users inner join Comments on Comments.UserId = Users.Id inner join Posts on Posts.OwnerUserId = Users.Id where (year(Comments.CreationDate)>=year(getdate())-5) --and (year(Posts.CreationDate)>=year(getdate())-5) group by Users.Id, Users.DisplayName order by CommentCount desc