Upvotes for questions older then 30 days

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT sum(Amount)
  FROM ( 
    SELECT PostId, Count(*) AS Amount
    FROM
        Votes v JOIN Posts p ON v.PostId=p.Id
    WHERE v.CreationDate > DATEADD(DD, 30, p.CreationDate)  AND VoteTypeId In (2,3)
      AND p.OwnerUserId = ##UserId##
    GROUP BY PostId
  ) AS v

Enter Parameters

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