Tags that can be cleared of questions in one close vote event

1

Please login or register to vote for this query.

(click on this box to dismiss)

This query is used in the close vote events: http://chat.stackoverflow.com/rooms/41570/so-close-vote-reviewers

Stack Overflow

Q&A for professional and enthusiast programmers

select t.tagname 
     , count(*)
from posts p
inner join posttags pt on pt.postid = p.id
inner join posttags mt on mt.postid = p.id
inner join pendingflags pf on pf.postid = p.id
inner join tags m on m.id = mt.tagid
inner join tags t on t.id = pt.tagid and t.id <> m.id
where m.tagname = '##tag##'
and p.id in (select p.id
   from posts p
   inner join posttags pt on pt.postid = p.id
   group by p.id
   having count(*)> 4)
and pt.tagid not in (
   select top 5 pt.tagid 
   from posts p
   inner join posttags pt on pt.postid = p.id
   inner join pendingflags pf on pf.postid = p.id
   group by pt.tagid
   order by count(*) desc
)
group by t.tagname
order by 2 desc

Enter Parameters

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