In MySQL, why does the following query return '----'
, '0'
, '000'
, 'AK3462'
, 'AL11111'
, 'C131521'
, 'TEST'
, etc.?
select varCharColumn from myTable where varCharColumn in (-1, '');
I get none of these results when I do:
select varCharColumn from myTable where varCharColumn in (-1);
select varCharColumn from myTable where varCharColumn in ('');
Note: I'm using MySQL version 5.0.45-log (show variables like "%version%";
)
Note 2: I tried this on a number column as well, but I do not get unexpected results there.
As documented under Comparison Functions and Operators: