Hi everybody!
I think that I am stuck with this particular situation:
Here are my tables:
item_table:
id | item
1 : A
2 : B
3 : C
attr_table:
attr | item_id
1 : 1
1 : 2
2 : 1
2 : 3
3 : 2
3 : 3
I would like to know if it is technically possible to retrieve any item which is associated with attr = 1 and 3. The answer should be 'B' only.
Likewise, if I request an item which is associated with attr = 1 and 2, I should get 'A' only.
The thing is that attr_table can potentially have a lot of rows and I wish to make only one query.
This question sounds easy and I am quite upset for not being able to answer it.
I was hoping that someone smarter could give me a hand...