Minimum, Maximum, and Average Number of Answers Per Post

0

Please login or register to vote for this query.

(click on this box to dismiss)

The minimum, maximum, and average number of answers per post on Stack Overflow.

Emacs

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

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results