Necromancer Badge For What?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Find all of a users answers with a score of 5 or more and computer the lag between the question asked date and the users answered date

English Language Learners

Q&A for speakers of other languages learning English

-- Necromancer Badge For What?
-- Find all of a users answers with a score of 5 or more and computer the lag between the question asked date and the users answered date

DECLARE @UserId int = ##UserId##

SELECT
  q.Title,
  q.CreationDate AS AskedDate,
  a.CreationDate AS AnsweredDate,
  DATEDIFF(day, q.CreationDate, a.CreationDate) AS DaysBetween,
  q.Id AS QuestionID,
  a.Id AS AnswerID
FROM
  Posts AS q JOIN Posts AS a ON a.ParentId = q.Id
WHERE
    a.OwnerUserId = @UserId
    AND a.PostTypeId = 2
    AND a.Score >= 4
;

Enter Parameters

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