List all questions, along with score, descriptive status, and close votes. - For closed questions, the close votes count includes all votes, except for mod hammers. - For open questions, the close votes count includes pending and aged away votes only.
Q&A about the site for operations research and analytics professionals, educators, and students
SELECT TOP ##MostRecent:int?100## p.Id AS [Post Link], p.Score AS [Score], IIF(p.DeletionDate IS NOT NULL and p.ClosedDate IS NOT NULL, 'Deleted after Closure', IIF(p.DeletionDate IS NOT NULL,'Deleted by User', IIF(p.ClosedDate IS NOT NULL, 'Closed', IIF(ISNULL(p.AnswerCount,0)=0, 'Unanswered', IIF(p.AcceptedAnswerId IS NULL,STR(p.AnswerCount)+' Answers', 'Accepted Answer'))))) [Status], p.CreationDate AS [Created At], ph.CreationDate FROM PostsWithDeleted AS p LEFT JOIN PostHistory AS ph ON p.Id = ph.PostId LEFT JOIN PostHistory AS pht ON p.Id = pht.PostId AND ph.CreationDate < pht.CreationDate WHERE p.PostTypeId = 1 AND pht.Id IS NULL ORDER BY p.CreationDate DESC;