User Answers over time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Programming Language Design and Implementation Meta

Q&A for designers and implementers of computer programming languages

DECLARE @UserId int = ##UserId##;
DECLARE @MinDate datetime = ##MinDate:string##;
DECLARE @MaxDate datetime = ##MaxDate:string##;

SELECT 
  COUNT(DISTINCT Answers.Id) AS Answers,
  SUM(Answers.Score) AS AnswerVotes,
  SUM(Questions.Score) AS QuestionVotes,
  SUM(Questions.ViewCount) AS Views
FROM 
  Posts AS Answers
  INNER JOIN Posts AS Questions ON (Answers.ParentId = Questions.Id)
WHERE 
  Answers.OwnerUserId = @UserId AND 
  Answers.CreationDate >= @MinDate AND
  Answers.CreationDate <= @MaxDate AND
  Answers.PostTypeId = 2;

Enter Parameters

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