I have a product table with a relationship to color table
a product can have many colors…
exp: Product A: has red, green blue yellow.
How may I select products which contain at least red and green(dynamic)?
example:
Product: RED GREEN - PASS
Product: RED GREEN YELLOW - PASS
Product: RED YELLOW - FAIL
Prefer join table solution or independent sub queries only
this problem is related to
One to Many search using AND condition
I’m trying to tackle it from fundamentals.
thanks in advance
Something like this should work
where the
HAVINGclause specifies the number of items in the list. So if you wanted products that are available in red, green, and yellow, you’d change the query to