See here for close reason types: http://data.stackexchange.com/stackoverflow/query/36599/show-all-types Note that if a question has been closed and reopened multiple times, all reasons will show up in the results.
Q&A for professional and enthusiast programmers
select top ##NumResults:int?50## p.Id, p.Id as [Post Link] from PostHistory ph inner join PostHistoryTypes pht on ph.PostHistoryTypeId = pht.id inner join Posts p on ph.PostId = p.Id --inner join PendingFlags pf on p.Id = pf.PostId where pht.id = 10 --and pf.CloseAsOffTopicReasonTypeId = ##CustomCloseReason:int?4##