Shows users with accept rates below a certain threshold
Q&A for scientific skepticism
-- Users with low accept rates -- Shows users with accept rates below a certain threshold WITH QuestionCounts AS ( SELECT p.OwnerUserId AS UserId, COUNT(*) AS QuestionCount, ISNULL(SUM(CASE WHEN p.AcceptedAnswerId IS NULL THEN 0 ELSE 1 END), 0) AS AcceptedCount FROM Posts p LEFT JOIN Posts aa ON aa.Id = p.AcceptedAnswerId WHERE p.PostTypeId = 1 AND (aa.Id IS NULL OR aa.OwnerUserId != p.OwnerUserId) AND (aa.Id IS NOT NULL OR EXISTS ( SELECT 1 FROM Posts a WHERE a.ParentId = p.Id AND a.Score > 0 )) GROUP BY p.OwnerUserId ), AcceptRates AS ( SELECT UserId, ISNULL(AcceptedCount, 0) / CAST(QuestionCount AS float) AS AcceptRate FROM QuestionCounts WHERE QuestionCount > ##MinQuestionCount## ) SELECT TOP ##MaxResults## UserId AS [User Link], AcceptRate * 100 AS AcceptRate FROM AcceptRates --WHERE AcceptRate <= (##MaxAcceptRatePercent## / 100.0) ORDER BY AcceptRate