Find questions with close votes by user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

DECLARE @UserId int = ##UserId##
SELECT
  p.Id as [Post Link], count(*) as [Occurrences]
FROM
  Posts p
  INNER JOIN
    Votes v
  ON
    p.Id = v.PostId
WHERE
  p.PostTypeId = 1
AND
  p.ClosedDate IS NULL
AND
  v.VoteTypeId = 6
AND
  p.OwnerUserId = ##UserId##
GROUP BY
  p.Id
HAVING
  count(*) >= 2
ORDER BY occurrences DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results