Top Close Voters

0

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

-- 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 = '1/1/2012'

SELECT TOP 10
  [u].[DisplayName],
  COUNT(1)
FROM [Users] [u] (NOLOCK)
  INNER JOIN [PostHistory] [ph] (NOLOCK) ON [ph].[Text] LIKE '%"Id":' + CAST([u].[Id] AS NVARCHAR) + ',%'
  INNER JOIN [Posts] [p] (NOLOCK) ON [p].[Id] = [ph].[PostId]
WHERE
  [u].[Reputation] >= 3000 AND
  [ph].[PostHistoryTypeId] = 10 AND -- 10 = "Post Closed"
  [p].[ClosedDate] >= @startDate
GROUP BY
  [u].[Id], [u].[DisplayName]
ORDER BY
  COUNT(1) DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results