Q&A for Ubuntu users and developers
-- Copy of the Top Close Voters query, with PostHistoryTypeId = 11 for Reopen -- http://data.stackexchange.com/programmers/query/90851/top-close-voters -- Returns all close voters since StartDate, ordered from most to least votes -- Only counts closed votes that actually resulted in a closure, -- and does not count deleted questions -- I wouldn't recommend running this on StackOverflow due to its size -- Variables - Set start date to timeframe you want declare @startDate datetime set @startDate = '10/1/2012' declare @userid int declare @users table ( userid int, ReopenCount int ) -- Cursor for all users who can vote to close declare cur cursor for select id from users where reputation >= 3000 and lastaccessdate >= @startDate open cur fetch next from cur into @userid while @@fetch_status = 0 begin insert into @users(userid, ReopenCount) SELECT @userid, count(*) FROM PostHistory WHERE PostHistoryTypeId = 11 AND Text LIKE '%"Id":' + CAST(@userid AS nvarchar) + ',%' and creationdate >= @startDate fetch next from cur into @userid end close cur deallocate cur -- Add Mark Trapp insert into @users(userid, ReopenCount) SELECT 8, count(*) FROM PostHistory WHERE PostHistoryTypeId = 11 AND Text LIKE '%"Id":' + CAST(8 AS nvarchar) + ',%' and creationdate >= @startDate -- Return results select top 100 u.ReopenCount, case when u.userid = 8 then 'Mark Trapp' else users.displayname end as 'User' from @users as u left outer join users on u.userid = users.id order by u.ReopenCount desc