What question has the most cycles of Close/Reopen?


Please login or register to vote for this query.

(click on this box to dismiss)


Stack Overflow

Q&A for professional and enthusiast programmers

select id
     , title
     , [closed]
     , [re-opened]
from posts p
inner join (
select top 10 postid
     , [10] as [closed]
     , [11] as [re-opened]
     from ( select postid, posthistorytypeid 
            from posthistory
            where posthistorytypeid in (10,11) --close/reopen
           ) as src
pivot ( 
  for posthistorytypeid
  in ([10], [11])
) as pvt
order by [10]+[11] desc
) ph on ph.postid = p.id
order  by [closed]+ [re-opened] desc

Enter Parameters

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