The minimum, maximum, and average number of answers per post on Stack Overflow.
Q&A for those using, extending or developing Emacs
---Counts votes for answers done before and after a badge with offset declare @offset int = 1 declare @start datetime = '2013/1/1' declare @end datetime = '2013/2/1' --Title "AfterBadgeOffsetX" select u.Id, (select count(*) from Badges bq where bq.Name = 'Nice Answer' and bq.Date <= b.Date and UserId= u.Id) as [AnswerBadgesEarned] from Badges as b inner join Users as u on b.UserId = u.Id where b.Name = 'Nice Answer' and u.CreationDate >= @start and u.CreationDate < @end order by u.CreationDate desc