Post Basics, Filtered (Tutorial)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

select top 500 concat('https://stackoverflow.com/questions/', PostId), Upvotes, Downvotes
from (
    select PostId, Upvotes, Downvotes, ((Upvotes + 1) / (Upvotes + Downvotes + 2)) as s
    from (
        select
            PostId, 
            Upvotes = sum(case when VoteTypeId = 2 then 1 else 0 end),
            Downvotes = sum(case when VoteTypeId = 3 then 1 else 0 end)
        from Votes
        where VoteTypeId in (2,3)
        group by PostId
    ) as VoteCounts inner join Posts on Posts.Id = VoteCounts.PostId
    where (Upvotes + Downvotes) > 0
) as Scores
order by s desc

Enter Parameters

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