Dias com >200 pontos


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow em Português

Perguntas e respostas para programadores profissionais e entusiastas

-- creditos: http://data.stackexchange.com/serverfault/query/39674/days-hit-rep-cap

-- Days hit rep cap
-- Enter Query Description

DECLARE @UserId int = ##UserId##
SELECT Row_Number() over (order by CreationDate) row, CreationDate, Votes
              SUM(case votes.votetypeid 
                      WHEN 1 THEN 15
                      WHEN 2 THEN 10 
                      WHEN 3 THEN -3
                      WHEN 9 THEN BountyAmount
               END) as Votes,
               Votes.CreationDate AS CreationDate
        FROM   Posts
               INNER JOIN Votes
                 ON Votes.PostId = Posts.Id
        WHERE  Posts.OwnerUserId = @UserId
               AND Posts.CommunityOwnedDate IS NULL
        GROUP  BY Votes.CreationDate
) t
WHERE Votes>=200

Enter Parameters

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