Q&A about the site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation
SELECT P.Id, P1.Id, P.AcceptedAnswerId, P.PostTypeId, P.CreationDate as QueDate, P1.CreationDate as AccAnsDate, DATEDIFF(second,p.CreationDate , p1.CreationDate) FROM Posts P Inner join Posts P1 On P.AcceptedAnswerId = P1.Id --Inner Join --Posts P2 On P.Id = P2.ParentId WHERE --AcceptedAnswerId is not null -- P.Id = 26223535 -- and year(p.CreationDate) =2017