select * from t1 where 字段 not in(select 字段 from t2) --查不出任何数据
select * from t1 where not exists(select 1 from t2 where t1.字段=t2.字段) 能查出数据原因:
由于t2.字段可能包含NULL!
Try!
select * from t1 where t1.字段 not in(select t2.字段 from t2 where t2.字段 is not null);
select * from t1 where 字段 not in(select 字段 from t2) --查不出任何数据
select * from t1 where not exists(select 1 from t2 where t1.字段=t2.字段) 能查出数据