select * from A where not (name in select name from B)选择在a.name在b.name中没有的记录。

解决方案 »

  1.   

    select * from A where  name not in (select name from B)
    或者
    select a.name ,a.col_1,a.col_n 
    from A a,B b
    where a.name <> b.name
      

  2.   


    select * from A where not (Fieldname  in (Select Fieldname from B)) Note:
    A.Fieldname 和 B.FieldName 相同
      

  3.   

    select * from a
    where not exists (
     select * from b
      where b.key=a.key
      )
      

  4.   

    select * from A where Fieldname not in (Select Fieldname from B)