I'm trying to get the total sum of likes a user has on his posts in SQL. Essentially I have the following table design:
Table Content :
poster_id == user
Simply join the two tables and use
COUNT(*) to count the selected rows.
SELECT COUNT(*) AS likes FROM Likes AS l JOIN Content AS c ON l.content_id = c.content_id WHERE c.poster_id = user AND l.upvoteOrDownVote = 'upvote'