User Answer Count Rank

0

Please login or register to vote for this query.

(click on this box to dismiss)

Health Meta

Q&A about the site for professionals in medical and allied health fields, students of those professions, related academics, and others with a sound understanding of medicine and healthcare-related sciences

WITH UserAnswerCount As (
  SELECT 
        OwnerUserId,
        COUNT(*) AS AnswerCount
  FROM Posts
  WHERE PostTypeId=2
    AND OwnerUserId IS NOT NULL
  GROUP BY OwnerUserId
),
OrderdUsers AS (
  SELECT OwnerUserId,
         AnswerCount,
         ROW_NUMBER() OVER (ORDER BY AnswerCount DESC) AS Rank
  FROM UserAnswerCount
)
SELECT Rank,
       OwnerUserId AS [User Link],
       AnswerCount
FROM OrderdUsers
WHERE Rank < 100
   OR OwnerUserId = ##UserId##
ORDER BY Rank

Enter Parameters

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