在SQL 中,not in 语句用法:
select * from hd123 where 号码 not in ( select phone from pusersinfo );
语句作用是查询出表hd123中号码不在pusersinfo中;但是有时候这个结果是错误的;
正确的语句是下面:
select * from hd123 where 号码 not in ( select phone from pusersinfo where phone is not null )。
过滤掉phone 是NULL的数据!