Is the following query
SELECT * FROM items WHERE field1 NOT LIKE '%a%' AND NOT LIKE '%b%' AND
NOT LIKE '%c%'
equivalent to
SELECT * FROM items WHERE field1 NOT IN ('a', 'b', 'c');
Generally speaking, which is the best way to exclude certain string values in a MySQL query?
Your first query:
is the same as this:
In that way, your two queries are NOT equivalent. Instead of your first query, you could also do something like this
See the manual about REGEXP for more info