I am strugling forming a query to accomplish what I need using LEFT JOIN. I'm afraid that I'm going about this the wrong way, so I reach out to the community.
I have two databases, one for categories and one for items as follows
CATEGORIES
id name private
1 Apples 1
2 Oranges 1
3 Grapes 0
ITEMS
id name category
1 Mcintosh 1
2 Fuji 1
3 Green 3
The Question
What I need to do is form a query that will select only the CATEGORIES that are private = 1 and that also have cases assigned to their category id (ie. cannot have 0 cases such as the Oranges category).
So in this case, my query would result in only 1 result: Apple