莫名奇妙的SQL语句问题,谁能帮我解答
语句1:select 序列号 from 维修明细 where 线号='B2' and 序列号 not in (select 产品编号 from abc)
语句2:select a.产品编号,b.序列号 from abc a,维修明细 b where a.产品编号=*b.序列号 and b.线号='B2'
问题1:语句1查询不到任何结果,语句2结果集中产品编号为空的又有很多,这不是矛盾的吗?
语句3:select * from (select a.产品编号,b.序列号 from abc a,维修明细 b where a.产品编号=*b.序列号 and 线号='B2') b
where 产品编号 is null
语句4:select a.产品编号,b.序列号 into #222 from abc a,维修明细 b where a.产品编号=*b.序列号 and 线号='B2'
select * from #222 where 产品编号 is null
问题2:语句3 满足条件的有298行,语句4的第二条语句却只有125行,为什么不相同