Number Upvotes and Downvotes and acceptance ratio for a meta.stackexchange question

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 count(case when VoteTypeId = 2 then 1 end) as [Upvotes],
  count(case when VoteTypeId = 3 then 1 end) AS [Downvotes],
  count(case when VoteTypeId = 2 or VoteTypeId = 3 then 1 end) as [Votes]
from Posts p inner join Votes v on p.Id = v.PostId
where p.PostTypeId = 1 and p.ClosedDate is null
group by p.Id

Enter Parameters

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