There are 2 tables

1) products

id | name | categoryID
------------------------
1 | Cola | one
2 | Fanta | one
3 | Lays | 2
4 | Tuk | 2


2) Categories

id | name | list
-----------------
1 | Juice | 0
1 | Snacks | one

I do not know how to write a SQL query to pull products, where in the category list is 0.

    1 answer 1

    Something like this

    SELECT * FROM products AS p INNER JOIN Categories AS c ON c.id = p.categoryID WHERE list = 0 GROUP BY p.id