Sorry if this has already been asked but it's a hard one to search for.
I have a column which consists of a list of words like "apple, grape, orange, banana, pear"
If I wanted to find a row which contained a certain word I would use a query like:
SELECT * FROM tablename WHERE 'apple' IN(list_of_words)
However What I would like to do is find all rows which contain several words. Something like this, which doesn't work:
SELECT * FROM tablename WHERE 'apple' IN(list_of_words) AND 'orange' IN(list_of_words)
using something like:
WHERE list_of_words LIKE "%grape%" AND list_of_words LIKE "%apple%"
Would also not work because then it would find "grapefruit" and "crabapple"
Is there any easy way of doing this already built into SQL?
Thanks.