Skip to content
Advertisement

How to implement LIKE functionality in a grouped query that depends on an IN operator? [closed]

After some great interaction here in Stack Overflow I am able to implement queries to get all dishes that include ingredients A and B and those that are composed of ONLY ingredients A and B.

Now, when users search for apple and pear, they should also find a dish called “fruit wonder” that contains Fuji apples and pear jam. Dishes containing ingredients such as green apple, red apple, apple jam, pear flavor, etc, should also be found. If I use the above query and search for apple and pear I will not find the “fruit wonder” dish.

Advertisement

Answer

I think you want:

You might also want:

If you want only apples and pears.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement