Possible with one MySQL query? “column contains any of the array's values”
Basically I want to check whether a mysql text column, which contains comma-separated values, contains any of the values contained in an array. I know this can be done with a loop and multiple queries, but I was hoping for a single query. Is this possible? Thank you. I would use a solution like this: SELECT * FROM yourtable WHERE str RLIKE CONCAT('[[:<:]]', REPLACE('values,in,the,array', ',', '[[:>:]]|[[:<:]]'), '[[:>:]]') this will make the following string: 'values,in,the,array' like this: [[:<:]]values[[:>:]]|[[:<:]]in[[:>:]]|[[:<:]]the[[:>:]]|[[:<:]]array[[:>:]] [[:<:]] and [[:>:]] are