nate_yhz

大道至简

导航

SQL关于差集

今天要弄一些数据在A表中存在的却不在B表的。。其中的B表的数据一定在A表存在的。。。

一直想把not in (.....) 改成 not exists (.....)

却一直忘了没关联外表...

故记下提醒之...

select * from table1 where not exists (select id from table2 where table1.name=table2.number)

posted on 2011-03-31 00:51  nate_yhz  阅读(190)  评论(0)    收藏  举报