日期:2014-05-19  浏览次数:20483 次

急死了,求救,高手帮忙
怎样求这样一个集合,两个表假设结构如下
A表   AID     NAME       B表     BID       AID   NAME
          1       xxx                     1           1       xxx
          2       xxx                     2           1       xxx
想得到AID   =   2

就是说想得到A表中AID在B表中AID没有出现的数据集合

高手帮忙啊,十分感谢                  
                                                                     


------解决方案--------------------
Select * From A Where AID Not In (Select Disticnt AID From B)
------解决方案--------------------
Select A.*,B.* From A Left Join B On A.AID=B.AID
Where b.AID is Null
------解决方案--------------------
select * from a表 where AID not in(select AID from b表)