Join results and sum of likes in a different table I have two databases, articles and article-likes.
I need the query to select everything from the article and add a row which is the sum of likes (we have -1 for dislike and +1 for like) from the table article-likes by searching for their ID.

Articles table:

 Article-Likes table:


For this instance, the article with ID Lorem-Ipsum should have 2 likes. On the other hand, Sit-Amet should have 1 like (1 + -1).
You can use a subquery to sum all likes of each article.

SELECT author,
       name,
       text,
       id,
       (SELECT SUM(value)
        FROM Articles-Likes
        WHERE articles_id = Articles.ID) as Likes  
from   Articles