piece of shit

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

with h as (

SELECT TOP 100

u.Id AS [User Link],

count(*) AS NumAnswers,

sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end) AS NumAccepted,

(sum(case when q.AcceptedAnswerId = a.Id then 1 else 0 end)*100.0/count(*)) AS AcceptedPercent

FROM Posts a

INNER JOIN Users u ON u.Id = a.OwnerUserId

INNER JOIN Posts q ON a.ParentId = q.Id

GROUP BY u.Id

HAVING count(*) > 20

ORDER BY AcceptedPercent DESC, NumAnswers DESC

)

SELECT * FROM h WHERE AcceptedPercent = (SELECT MAX(AcceptedPercent) FROM h) ;

Enter Parameters

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