Reputation vs New Reputation Only for Last Month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for professionals, academics, and students working within the systems development life cycle

WITH  TOP_Traditional AS (
SELECT top 100
    OwnerUserId,  
    SUM(Case WHEN v.VoteTypeID = 1 THEN 15
             WHEN v.VoteTypeID = 1 AND p.PostTypeID = 1 THEN  5
             WHEN v.VoteTypeID = 2 AND p.PostTypeID = 2 THEN  10
             WHEN v.VoteTypeID = 3 THEN  -2 END)  as RepEarned
FROM 
posts p
INNER JOIN Votes v
ON v.PostId = p.Id
WHERE OwnerUserId is not null
and v.creationDate >= '2012-04-01'
and v.creationDate < '2012-05-01'
GROUP BY 
  OwnerUserId
ORDER BY 
RepEarned DESC),
 TOP_NEWOnly AS (
SELECT top 100
    OwnerUserId,  
    SUM(Case WHEN v.VoteTypeID = 1 THEN 15
             WHEN v.VoteTypeID = 1 AND p.PostTypeID = 1 THEN  5
             WHEN v.VoteTypeID = 2 AND p.PostTypeID = 2 THEN  10
             WHEN v.VoteTypeID = 3 THEN  -2 END)  as RepEarned
FROM 
posts p
INNER JOIN Votes v
ON v.PostId = p.Id
WHERE OwnerUserId is not null


and v.creationDate >= '2012-04-01'
and v.creationDate < '2012-05-01'
and p.creationDate >= '2012-04-01'
and p.creationDate < '2012-05-01'

GROUP BY 
  OwnerUserId
ORDER BY 
RepEarned DESC)
SELECT * FROM
TOP_Traditional t
FULL OUTER JOIN TOP_NEWOnly n
ON t.OwnerUserID  = n.OwnerUserId

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results