products purchased
--------------------------
bana
bana
bana
stra
kiwi
reward requirements table (related to a rewards table)
reward id, products
----------------------
1,bana
1,bana
1,bana
2,stra
2,bana
3,stra
4,cart
5,bana
5,bana
5,oliv
Can you help me with sql to get rewards
the products purchased qualifies for?
In the case above the reward ids would be:
1
2
3
If there is a better design that would make the solution easier I welcome those as well. I'm using product names for the sake of easier explaining, I hope. (I'll replace with product ids later)