Q&A for people studying math at any level and professionals in related fields
SELECT TOP(##num?100##) p.Id AS [Post Link], 'site://posts/' + CAST(p.Id AS varchar)+'/revisions' AS [Revision History], 'site://posts/' + CAST(p.Id AS varchar)+'/timeline' AS [Timeline], DATEDIFF(year, p.CreationDate, p.ClosedDate) AS Years, DATEDIFF(month, p.CreationDate, p.ClosedDate) AS Months, DATEDIFF(day, p.CreationDate, p.ClosedDate) AS Days, DATEDIFF(hour, p.CreationDate, p.ClosedDate) AS Hours, DATEDIFF(minute, p.CreationDate, p.ClosedDate) AS Minutes FROM PostsWithDeleted p WHERE p.ClosedDate IS NOT NULL ORDER BY DATEDIFF(minute, p.CreationDate, p.ClosedDate) DESC