My Top Voted Answer Rate

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @UserId int = ##UserId##


SELECT CAST(COUNT(Id) AS FLOAT) AS [Post Link]
  FROM Posts a
  WHERE a.OwnerUserId = @UserId
  AND a.PostTypeId = 2
  AND (Score = (
    SELECT MAX(Score) FROM Posts b WHERE b.ParentId = a.ParentId));

Enter Parameters

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