SELECT p.Id, COUNT(*) AS Upvotes FROM Posts p INNER JOIN ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

SELECT 
    p.Id,
    COUNT(*) AS Upvotes
FROM Posts p
INNER JOIN 
  Votes ON p.Id = Votes.PostId
WHERE Votes.VoteTypeId = 2 -- upvotes
GROUP BY p.Id

Enter Parameters

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