I'm having an issue with mysql when doing a JOIN of two tables and filtering using HAVING for these two tables.
Assume my tables look like this:
Products:
id | Name
1 | Product 1
2 | Product 2
3 | Product 3
Reviews:
Name | Product_id | score
Review 1 | 1 | 10000
My best guess was the following, but it doesn't work:
SELECT "products".*, sum("reviews".score) FROM "products" INNER JOIN "reviews" ON "reviews"."empire_id" = "products"."id" GROUP BY products.id HAVING sum("reviews".score)=0;
And I would like to get the products that have a score of 0, meaning that they have not been reviewed. I feel like this should be easy, but I can't seem to figure out.