fastest answers in all tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Engineering

Q&A for professionals and students of engineering

SELECT distinct top 50 
  answer.id as [Post Link],
  answer.ownerUserID as [User Link],
  datediff(second, question.CreationDate, answer.CreationDate) as seconds,
  cast(datediff(day, question.CreationDate, answer.CreationDate) as char(8)) + 'days, ' +
  cast((datediff(second, question.CreationDate, answer.CreationDate)/3600)%24 as char(8)) + 'hours, ' +
  cast((datediff(second, question.CreationDate, answer.CreationDate)/60)%60 as char(8)) + 'minutes, ' +
  cast(datediff(second, question.CreationDate, answer.CreationDate)%60 as char(8)) + 'seconds' as 'time'
FROM 
    posts as question
  inner join 
    posts as answer
      on
        question.acceptedAnswerID = answer.id
      and
        question.ownerUserID != answer.ownerUserID
WHERE
  datediff(second, question.CreationDate, answer.CreationDate) > 0
  AND answer.ownerUserId = 2242
ORDER BY 
  seconds asc, 
  answer.id asc, 
  time asc

Enter Parameters

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