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 desc, answer.id asc, time asc