You should never mix quoted and unquoted values in an IN list : IN « Comparison Functions Operators « MySQL Tutorial






SELECT val1 FROM tbl1 WHERE val1 IN (1,2,'a');

Instead, write it like this:

SELECT val1 FROM tbl1 WHERE val1 IN ('1','2','a');








15.7.IN
15.7.1.expr IN (value,...)
15.7.2.SELECT 'A' IN ('A','B','C');
15.7.3.You should never mix quoted and unquoted values in an IN list
15.7.4.Use IN with data in a table
15.7.5.Using IN with subquery
15.7.6.Using more than one column with a NOT IN operator