Minimum, Maximum, and Average Number of Answers Per Post


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.


Q&A for those using, extending or developing Emacs

---Counts votes for answers done before and after a badge with offset
declare @offset int = 0
declare @start datetime = '2013/1/1'
declare @end datetime = '2013/2/1'

--Title "AfterBadgeOffsetX"
    (select score
     from Posts pb 
     where pb.posttypeid=2 
     and pb.CreationDate >= b.Date
     and pb.OwnerUserId= u.Id 
      order by CreationDate asc
     offset @offset ROWS fetch next 1 row only) as [FAnswer Score]
    from Badges as b
    inner join Users as u
    on b.UserId = u.Id
    b.Name like '% Answer' and
     u.CreationDate >= @start and
    u.CreationDate < @end
    order by u.CreationDate desc

Enter Parameters

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