mysql joins - how to find all children that belongs to ALL parents
- by kimsia
I have three mysql tables
items
the columns are id, title
items_in_categories
the columns are id, item_id, category_id
categories
the columns are id, title
I want to find all the items that belong to ALL the stated categories. Not any one category, but ALL categories
Eg, if I want to search all the items that belongs to category id 3 and 5
I would like to use as simple a way as possible.
I have tried AND and a nested NOT EXISTS as stated in the mysql manual.
Nothing worked.