Posts with most reviews of a specific type and state

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

SELECT TOP(##num?100##)
  COUNT(Id) AS Count,
  PostId AS [Post Link],
  timeline = 'site://posts/' + CAST(PostId AS varchar)+'/timeline',
  revisions = 'site://posts/' + CAST(PostId AS varchar)+'/revisions'
FROM ReviewTasks  
WHERE (ReviewTaskTypeId=##type?2##) AND (ReviewTaskStateId=##state?3##)  
GROUP BY PostId
ORDER BY COUNT(Id) DESC

--ReviewTaskTypeId (listed in ReviewTaskTypes)
--1 = Suggested Edit
--2 = Close Votes
--3 = Low Quality Posts
--4 = First Post
--5 = Late Answer
--6 = Reopen Vote
--7 = Community Evaluation
--8 = Link Validation
--9 = Flagged Posts
--10 = Triage
--11 = Helper

---ReviewTaskStateId (listed in ReviewTaskStates)
---1 = Active
---2 = Completed
---3 = Invalidated

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results