SELECT Q.Id, Q.CreationDate AS QuestionDate, A.CreationDa...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Academia Meta

Q&A about the site for academics and those enrolled in higher education

SELECT
  Q.Id,
  Q.CreationDate AS QuestionDate,
  A.CreationDate AS AnswerDate,
  RANK() OVER (PARTITION BY Q.Id ORDER BY A.CreationDate) AS AnswerNumber
FROM (Posts as Q INNER JOIN Posts as A ON A.ParentId = Q.Id)
WHERE
  Q.PostTypeId = 1 AND
  Q.CreationDate >= '20210601' AND
  Q.CreationDate < '20210608'
ORDER BY QuestionDate, Q.Id, AnswerDate;

SELECT
  Q.Id,
  Q.CreationDate AS QuestionDate,
  A.CreationDate AS AnswerDate
FROM (Posts as Q LEFT OUTER JOIN Posts as A ON A.ParentId = Q.Id)
WHERE
  Q.PostTypeId = 1 AND
  Q.CreationDate >= '20210601' AND
  Q.CreationDate < '20210608'
ORDER BY QuestionDate, Q.Id, AnswerDate;

Enter Parameters

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