Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs
select count(*) N, ot.MarkdownMini reason
from CloseAsOffTopicReasonTypes ot
join PendingFlags f on CloseAsOffTopicReasonTypeId = ot.Id
join Posts p on f.PostId = p.Id
join PostHistory ph on p.Id = ph.PostId
inner join CloseReasonTypes cr on ph.Comment = cr.Id
where PostHistoryTypeId = 10
and f.Id = (select max(f2.Id)
from PendingFlags f2
where f2.PostId = p.Id and FlagTypeId = 14)
and cr.Name = 'off-topic'
-- and p.CreationDate between '2013-10-09' and '2013-10-10'
-- and ph.CreationDate between '2013-12-09' and '2013-12-10'
group by ot.MarkdownMini
order by count(*) desc;