Top one hit wonders

1

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Different

Q&A for power users of Apple hardware and software

-- List of users who have only one very high upvoted answer

-- Get all users with only 1 answer
SELECT u.Id, u.Reputation
INTO #UsersWithOnePost
FROM Users u
LEFT JOIN Posts a ON u.Id = a.OwnerUserId
WHERE a.PostTypeId = 2
GROUP BY u.Id, u.Reputation
HAVING COUNT(a.Id) = 1

-- Get top one hit wonders
SELECT TOP 1000
  u.Id [User Link],
  a.Id [Post Link],
  a.Score,
  u.Reputation
FROM #UsersWithOnePost u
LEFT JOIN Posts a ON u.Id = a.OwnerUserId
WHERE a.PostTypeId = 2
ORDER BY a.Score DESC

Enter Parameters

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