SELECT OwnerUserId AS UserId, COUNT(CASE WHEN PostTypeId ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Psychology and Neuroscience

Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

SELECT 
    OwnerUserId AS UserId,
    COUNT(CASE WHEN PostTypeId = 1 THEN 1 ELSE NULL END) AS NumQuestions,
    COUNT(CASE WHEN PostTypeId = 2 THEN 1 ELSE NULL END) AS NumAnswers,
    SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS Upvotes,
    SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS Downvotes
FROM Posts
JOIN Votes ON Posts.Id = Votes.PostId
WHERE 
    OwnerUserId IN (SELECT Id FROM Users WHERE Reputation BETWEEN 1 AND 999)
    AND Posts.CreationDate >= '2018-01-01' AND Posts.CreationDate < '2020-01-01' -- Filter for posts created between 2018-01-01 and 2019-12-31
GROUP BY OwnerUserId;

Enter Parameters

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