I have a products table (Product) and all products have assigned filters in a filters join table (Product_Filter_Join), (Classic, Round, Wood, moodern, dining, etc.). My problem is that I cannot figure out how to show the -distinct- values from the table Product and when listing this products all filter values have to match.
+---------------------+-------------+-----------+ | * Product_Table | | | | productID | productName | | | 1 | table 1 | | | 2 | table 2 | | | 3 | table 3 | | | 4 | table 4 | | | | | | | * Filter_Join_Table | | | | FilterJoinID | filterID | productID | | 1 | 11 | 1 | | 2 | 12 | 1 | | 3 | 14 | 1 | | 4 | 11 | 2 | | 5 | 11 | 3 | | 6 | 12 | 3 | | 7 | 14 | 3 | | 8 | 13 | 4 | | | | | | ** Filter_Table | | | | filterID | FilterName | | | 11 | Classic | | | 12 | Wood | | | 13 | modern | | | 14 | dining | | +---------------------+-------------+-----------+
In this scheme the result will be: Table 1, Table 3 because they are the only products that share all the filters.
Hope that someone can provide some good, simple solutions on my problem.