I didn’t even know how to come up with a good title, so I hope I can describe my problem in a right way 🙂
So I have a person table, and it has a N:N relationship with keywords via the table PersonKeywords.
Then I also have a Search table, and it also has a N:N relationship with keywords via the table SearchKeywords.
Now the person can have a relationship with keyword A and B, and the search record can have a relationship with the keywords A and C.
Now I want the person in my resultset, because it has at least one (in this ‘A’) of the keywords the search record has.
I also want the person who has ‘A’, the one with ‘C’, the one with ‘A’ and ‘C’, but not the one with only B.
So it’s a match on two lists, but I don’t know where to start to create such a statement…
So you have three people…
Babs has A and B, Ken has A and C, Neville has B only and Sue has C only
The search is for A or C
So…
Gives