大道至简
今天要弄一些数据在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) 收藏 举报
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3