select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and
not exists( select * from tmp_ddn_guoji where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_vpn where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_shangwang where sn_97 = a.sn_97 ))
和select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and
a.sn_97 not in ( select sn_97 from tmp_ddn_guoji )
and a.sn_97 not in ( select sn_97 from tmp_ddn_vpn )
and a.sn_97 not in ( select sn_97 from tmp_ddn_shangwang )这两语句的意思应该相同吧?为什么结果不同?
where b.order_item_id = a.root_order_item_id and
not exists( select * from tmp_ddn_guoji where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_vpn where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_shangwang where sn_97 = a.sn_97 ))
和select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and
a.sn_97 not in ( select sn_97 from tmp_ddn_guoji )
and a.sn_97 not in ( select sn_97 from tmp_ddn_vpn )
and a.sn_97 not in ( select sn_97 from tmp_ddn_shangwang )这两语句的意思应该相同吧?为什么结果不同?
select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and (A.SN_97 IS NOT NULL)
not exists( select * from tmp_ddn_guoji where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_vpn where sn_97 = a.sn_97 )
and not exists( select * from tmp_ddn_shangwang where sn_97 = a.sn_97 ))
把
select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and
a.sn_97 not in ( select sn_97 from tmp_ddn_guoji )
and a.sn_97 not in ( select sn_97 from tmp_ddn_vpn )
and a.sn_97 not in ( select sn_97 from tmp_ddn_shangwang )
改成
select b.* from tmp_ddn a,tmp_ddn b
where b.order_item_id = a.root_order_item_id and
a.sn_97 not in ( select sn_97 from tmp_ddn_guoji )
and a.sn_97 not in ( select sn_97 from tmp_ddn_vpn where sn_97 is not null )
and a.sn_97 not in ( select sn_97 from tmp_ddn_shangwang where sn_97 is not null )
结果就一样了