Fastest question to answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

SELECT TOP 100 
  P.Title, 
  P.Id,
  P.PostTypeId,
  'http://stackoverflow.com/q/' + CAST(P.Id as nvarchar(15)) + '/365526' Url,
  -- Might as well include a url
  DATEDIFF(second, P.CreationDate, A.CreationDate) SecondsToAnswer
FROM Posts P
INNER JOIN 
  Posts A ON 
        A.Id = P.AcceptedAnswerId
    AND DATEDIFF(second, P.CreationDate, A.CreationDate) > 0
WHERE 
      P.ClosedDate IS NULL
  --We only want records that aren't already closed
  
  AND P.AnswerCount > 0
  --Only questions with answers
  
  --AND DATEDIFF(second, P.CreationDate, A.CreationDate) > 0
  --This to prevent results showing answers earlier
  --than thee questions
  
ORDER BY SecondsToAnswer

Enter Parameters

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