查询的一个怪问题,IN语句怎么不管用?
我在执行
select * from table1 where a='z001'
select * from table1 where a in ('z001')
或
select * from table1 where a='z002'
select * from table1 where a in ('z002')
时都能查出结果,
但执行如下语句就查不出结果:
select * from table1 where a in ('z001','z002')
如果执行
select * from table1 where a not in ('z001','z002')就能把其他的数据都查到,
感觉比较奇怪;
字段a是主键,
大家帮忙解释一下为什么in那么怪?
谢谢!