Last year's popular questions ordered by Wilson Score

1

Please login or register to vote for this query.

(click on this box to dismiss)

Raspberry Pi

Q&A for users and developers of hardware and software for Raspberry Pi

SELECT TOP 200
    s.Id AS [Post Link],
    s.Tags,
    s.ViewCount,
    s.CreationDate,
    s.Score AS Score,
    (CASE s.Up WHEN 0 THEN 0 ELSE (s.Up + 1.96 * 1.96 / 2 - 1.96 * sqrt(s.Up * s.Down * 1.0 / s.Total + 1.96 * 1.96 / 4)) / (s.Total + 1.96 * 1.96) END) AS WilsonScore
FROM (
    SELECT p.Id AS Id,
        count(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE NULL END) AS Up,
        count(CASE v.VoteTypeId WHEN 3 THEN 1 ELSE NULL END) AS Down,
        count(v.VoteTypeId) AS Total,
        p.Score AS Score,
        p.Tags,
        p.ViewCount,
        p.CreationDate
    FROM Posts AS p
    LEFT JOIN Votes AS v ON v.PostId = p.Id
        AND v.VoteTypeId IN (2, 3)
    WHERE p.PostTypeId = 1
        AND p.AnswerCount > 0
        AND p.CreationDate >= DATEADD(DAY, -##DaysSince:int?365##, GETDATE())
        -- AND p.Tags LIKE CONCAT('%', ##TagName:string?python##, '%')
    GROUP BY p.Id,
        p.Tags,
        p.ViewCount,
        p.CreationDate,
        p.Score
    ) AS s
ORDER BY WilsonScore DESC

Enter Parameters

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