Total Upvotes for Self-Answered Questions in Under 3 Seconds

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga Meta

Q&A about the site for anime and manga fans

SELECT 
    q.OwnerUserId AS UserID,
    SUM(q.Score + a.Score) AS TotalGainedUpvotes
FROM 
    Posts AS q
JOIN 
    Posts AS a ON q.Id = a.ParentId
WHERE 
    q.PostTypeId = 1  -- 1 indicates questions
    AND a.PostTypeId = 2  -- 2 indicates answers
    AND q.OwnerUserId = a.OwnerUserId -- same User ID
    AND DATEDIFF(second, q.CreationDate, a.CreationDate) < 3 -- answered themselves in less than 3 seconds
GROUP BY 
    q.OwnerUserId

Enter Parameters

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