We have a table of products and a table of features. And then we have a three-field reference table that ties a product to a feature - one record per product/feature combo, with the productID as the key into the product table, and the feature ID as the key into the feature table - the third field is just an ID field.
My problem is to find the products that have all of features A, B, and C.
So how do I construct a query that finds the products that have a given set of features - an AND set if I just had a table whose record was a product ID field and a separate field for each feature. But with each feature in a separate record, an AND query won't work.
Do I create a temporary table populated by an OR query, and then query that table for products with a record count = the number of features in the OR query?
It is not possible to change the structure of the product or the feature table or of the product/feature reference table.