Avatar of trevor1940
trevor1940

asked on 

SQL: Can you combine LIKE and IN within a single query?

Hi

Can you combine LIKE and IN within a single MYSQL query?

I have a list of codes I need to search for something like this

select * FROM mytable WHERE codes LIKE '%ABC%' OR code LIKE '%XYZ%';

Open in new window


The problem is the column codes  contains a coma separated list eg "ABC,EFG,XYZ"  so a standard IN clause wont work
SQL

Avatar of undefined
Last Comment
trevor1940

8/22/2022 - Mon