SELECT * FROM table1 WHERE a = '1'; SELECT * FROM table1 WHERE a = CONVERT(1, CHAR);
Column a is VARCHAR type, and I have already created an index on it. The first one uses index but the second one doesn't. Any Clue on this?
I suspect that maybe MySQL takes CHAR and VARCHAR as two different types, so I changed column a to CHAR, and the index doesn't work either.