Q&A for SharePoint enthusiasts
SELECT q.Id AS QuestionId, q.Title, q.CreationDate AS QuestionCreationDate, MIN(a.CreationDate) AS FirstAnswerDate, DATEDIFF(DAY, q.CreationDate, MIN(a.CreationDate)) AS DaysToFirstAnswer FROM Posts q JOIN Posts a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 -- 1 for Questions AND a.PostTypeId = 2 -- 2 for Answers GROUP BY q.Id, q.Title, q.CreationDate HAVING DATEDIFF(DAY, q.CreationDate, MIN(a.CreationDate)) > 1 ORDER BY DaysToFirstAnswer DESC;