@
注册会员

UID 90178
精华
0
积分 77
帖子 109
金钱 77 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2007-3-27
状态 离线
|
[推荐阅读] 99Click.com 诚聘软件工程师
首先要对b 的id 做索引。
第一种
select * from a where not exists (select id from b where b.id=a.bid) ;
第二种
select * from a where not exists (
select A2.id from (select B1.id from a A1,b B1 where A1.bid = B1.id) A2 where a.bid = A2.id
);
不论如何, 在b表建立id索引都很重要。
|
|