Q&A about the site for software quality control experts, automation engineers, and software testers
declare @Location nvarchar(100), @startdate date ,@enddate date set @Location =N'reading' set @startdate='9/1/11' set @enddate='10/1/11' select top 1000 u.reputation, u.displayname, u.aboutme, sum(p.score) as postscores, sum(c.score) as commenttscore from dbo.users u left join dbo.posts p on u.id =p.owneruserid and p.creationdate between @startdate and @enddate left join comments c on u.id =c.userid and c.creationdate between @startdate and @enddate where u.location=@location group by u.reputation, u.displayname, u.aboutme order by sum(p.score) desc