如题

解决方案 »

  1.   

    select a.* 
    from A表 a left join B表 b on a.c=b.c
    where b.c is null
      

  2.   

    ---examplecreate table A表(id int,c int)
    insert A表
    select 10,1
    union select 11,2
    union select 12,3
    union select 11,4
    union select 11,5
    union select 11,6
    union select 11,7
    union select 11,8
    union select 11,9
    union select 11,10
    go
    create table B表(id int,c int)
    insert B表
    select 10,1
    union select 11,2
    union select 12,3
    go
    select a.* 
    from A表 a left join B表 b on a.c=b.c
    where b.c is null
    go
    drop table A表,B表
      

  3.   

    select a.c from a left join b on a.c=b.c where b.c is null
      

  4.   

    select c from a where not exists(selec 1 from b where c=a.c)