SELECT TOP 5 PostId AS [Post Link], PostScore, UpDnVoteS...

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

-- Enter Query Title
-- Enter Query Description

SELECT TOP 5
    PostId AS [Post Link],
    PostScore,
    UpDnVoteScore + FlagScore
    FROM
    (
        SELECT
            p.Id AS PostId,
            p.Score AS PostScore,
            SUM(CASE v.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) AS UpDnVoteScore,
            SUM(CASE v.VoteTypeId WHEN 4 THEN -1 WHEN 12 THEN -1 END) AS FlagScore
            FROM Posts p
            INNER JOIN Votes v ON p.Id = v.PostId
            WHERE v.VoteTypeId IN (2, 3, 4, 12)
            GROUP BY p.Id, p.Score
    ) s
    WHERE PostScore != UpDnVoteScore

Enter Parameters

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