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 10 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 = 4