last week toppers based up on up-votes and down-votes by vinu

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

-- you can add the date in the creation date

SELECT top 100
us.Id
,count(p.OwnerUserId) as cnt,
us.DisplayName,
CASE
    WHEN v.VoteTypeId = 2 THEN 5
    WHEN v.VoteTypeId = 3 THEN -2
END as c_scr
,SUM(v.VoteTypeId) as [final_score]

FROM votes v

INNER JOIN Posts p on v.PostId = p.Id
INNER JOIN Users us on p.OwneruserId = us.Id

/*INNER JOIN (SELECT Id, count(Id) as cnt
                     FROM Users
                     GROUP BY Id) us on p.OwneruserId = us.Id*/

WHERE v.CreationDate between '2011-03-04 00:00:00' and '2011-03-11 00:00:00'
AND (v.VoteTypeId = 2
OR v.VoteTypeId = 3)

GROUP by us.Id,us.DisplayName,v.VoteTypeId
order by final_score desc

Enter Parameters

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