select v.PostId as ID, count(v.PostId) as cnt, SUM(CASE W...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ukrainian Language Meta

Q&A for linguists, teachers and students of the Ukrainian language

select v.PostId as ID, count(v.PostId) as cnt,
SUM(CASE WHEN VoteTypeId = 2 THEN 5 ELSE 0 END) AS UpVotes,
SUM(CASE WHEN VoteTypeId = 3 THEN -2 ELSE 0 END) AS DownVotes
from 
Users as u join Posts as p 
on u.Id = p.OwnerUserId
join Votes as v on p.Id = v.Id
where 
(v.CreationDate between '2011-03-11 00:00:00' and '2011-03-18 00:00:00') 
and (v.VoteTypeId=2 or v.VoteTypeId=3)
group by v.PostId
order by count(v.PostId) desc

Enter Parameters

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