select * from 表1 where 字段A not in 
(select 字段A from 表2)

解决方案 »

  1.   

    select a.* from 表1 a where a.字段A<>表2.字段A ordar by a.字段A
      

  2.   

    select * from 表1 
    where not exists
    (select 1 from 表2 where 表2.字段A =表1.字段A )
      

  3.   

    select t.* from 表1 t where not exists(select 1 from 表2 字段A=t.字段A)
      

  4.   

    create table #t (col varchar(1))
    insert into #t
    select 'a'
    union
    select 'c'
    union
    select 'f'create table #t2 (col varchar(1))
    insert into #t2
    select 'a'
    union
    select 'b'
    union
    select 'c'
    union
    select 'd'
    union
    select 'e'
    union
    select 'f'select a.* from #t2 a left join #t b on a.col=b.col where b.col is null
    col  
    ---- 
    b
    d
    e
      

  5.   

    select a.字段A from 表1,表2  where a.字段A<>表2.字段A
      

  6.   

    最简单的
    select a.A from a
    where A not in(select A from b)或者select a.A
    from a,b
    where a.A *=b.A
    and b.A is not null
     
      

  7.   

    学习学习
    tangqijun199(撒旦.搏一搏,3角变4角.冲刺5角中……
    回答的好认真,赞一下