High-Scoring Questions with Accepted Answers (Tutorial)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

-- This query uses JOINs to show question score, accepted-answer score
-- (if an answer was accepted), asker, and answerer.

SELECT p.Title, p.Id AS [Post Link], p.Score, a.Score AS "Accepted Score", 
u.DisplayName AS "Asker", au.DisplayName AS [User Link]
  
FROM Posts p
JOIN Posts a ON p.AcceptedAnswerId = a.Id
JOIN Users u ON p.OwnerUserId = u.Id
JOIN Users au ON a.OwnerUserId = au.Id

WHERE p.PostTypeId = 1
AND p.Tags like ('scala')
and p.AcceptedAnswerId IS NOT NULL

ORDER BY p.Score DESC

Enter Parameters

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