not exists不能仅仅理解为差集
要看以谁为主表,
见如下示例,同样的表,主表不一样,结果不一样:
?
?
select * from [left] lwhere not exists (select * from [right] rwhere l.name=r.name)-------------------------------下面这个例子充分说明,not exists不能单单理解为差集select * from [right] rwhere not exists (select * from [left] lwhere l.name=r.name)?
?
?
?
?
?
?