select * from 表1 where not exists(select * from 表2)

解决方案 »

  1.   

    select * from tb1 
    where not exists(select 1 from tb2 where tb1.col1=tb2.col1 and ...... and tb1.coln=tb2.coln)select * from tb2 
    where not exists(select 1 from tb1 where tb2.col1=tb1.col1 and ...... and tb2.coln=tb1.coln)
      

  2.   

    邀邹老大看看:http://community.csdn.net/Expert/topic/3846/3846731.xml?temp=4.327029E-02
      

  3.   

    select * from tablename1 where not exists(select * from tablename2)
      

  4.   

    A:36000,B:34000
    select * from A where A.id not in(select id from B)