I have a problem selecting from a link table and filtering out superfluous results.
Publications belong to packages by means of the package_publications table.
For instance, I know the ids of my publications to be 11 and 47. I want to return a package that has ONLY those publications in it.
Now if I do a join and do something like where publications.id IN (11, 47)
after the obvious inner joins, this will simply return all packages that have either one of those values in the package_publications link table.
I want to match packages that only have BOTH (or more - it isn't limited to two). Effectively I'm using an OR when I want an AND but I don't know how to approach it SQL-wise.