Wednesday, 28 August 2013

Check single column for multiple values mysql

Check single column for multiple values mysql

I have a table 'optionsproducts' having the following structure and values
ID OptionID ProductID
1 1 1
1 2 1
1 3 1
1 2 2
1 2 3
1 3 3
Now I want to extract ProductIDs against which both OptionID 2 and
OptionID 3 is assigned. Which means in this case ProductID 1 and 3 should
be returned. I am not sure what I am missing. Any help will be
appreciated.

No comments:

Post a Comment