Q&A about the site for Ubuntu users and developers
SELECT DATEDIFF(second, Answers.AnswerDate, Posts.CreationDate) as Diff FROM Posts JOIN (SELECT Id as AnswerId, CreationDate as AnswerDate FROM Posts WHERE PostTypeId = 2) as Answers ON Posts.AcceptedAnswerId = Answers.AnswerId WHERE Posts.PostTypeId = 1 AND YEAR(Posts.CreationDate) = 2017;