Answers per day on [rust]: total vs. Shepmaster's answers vs. your answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

DECLARE @YourId int = ##UserId##

SELECT
   MIN(answers.CreationDate),
   (COUNT(*) + 0.0) / DATEPART(day, EOMONTH(MIN(answers.CreationDate))) 
     as 'answers per day',
   -- count the answer from Shepmaster (ID 155423)
   (COUNT(
     case answers.OwnerUserId when 155423 then 1 else null end
   ) + 0.0) / DATEPART(day, EOMONTH(MIN(answers.CreationDate)))
     as 'Shepmasters answers per day',
     
    -- count the answer from you
   (COUNT(
     case answers.OwnerUserId when @YourId then 1 else null end
   ) + 0.0) / DATEPART(day, EOMONTH(MIN(answers.CreationDate)))
     as 'Your answers per day'
   
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id
    INNER JOIN Posts questions ON questions.Id = PostTags.PostId
    INNER JOIN Posts answers ON answers.ParentId = questions.Id
WHERE 
    Tags.tagname = 'rust' AND
    answers.CreationDate > '2013-01-01' AND
    answers.PostTypeId = 2  -- type = answers
  GROUP BY DATEPART(month, answers.CreationDate), DATEPART(year, answers.CreationDate)
  ORDER BY MIN(answers.CreationDate)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results