sql求助
一个表a(多于一个的主键),表b是表a中符合一定条件的记录,
如何得出表a中不包括表b的结果集
问题点数:20、回复次数:3Top
1 楼friendliu(无为)回复于 2004-08-01 18:43:21 得分 0
select * from b where not exists(select * from a where......)Top
2 楼tx1icenhe(冒牌马可 V0.4)回复于 2004-08-01 18:57:50 得分 20
select * from a
where not exists(
select 1 from b
where aKey1=a.aKey1
and aKey2=a.aKey2
...
)
--aKey1,aKey2,...是a表的主键字段
Top
3 楼zhangzs8896(小二)回复于 2004-08-01 20:08:53 得分 0
select * from b where not exists(select * from a where......)
Top




