mysql use like with multiple values
Posted: Tue May 26, 2015 6:55 pm
Hello,
I having a query that has to search multiple values:
I'm wondering if there isn't a faster way?
Something like
But this doesn't work, it only works if you search the full value, not part of string.
I having a query that has to search multiple values:
Code: Select all
SELECT id,name FROM table WHERE name LIKE '%value1%' OR name LIKE '%value2%' OR name LIKE '%value3%'
Something like
Code: Select all
SELECT id,name FROM table WHERE name LIKE IN ('%value1%','%value2%','%value%')