select * from t1 where a not in(select a from t2)

解决方案 »

  1.   

    回复人: laiyiling(CSDN上的流浪汉) 这语句如果是只有字段的就可以通过.
    对于多字段是不行的啦
      

  2.   

    回复人: skyboy0720(飞) ( ) 
    为什么要标识唯一性啊?
      

  3.   

    select *
    from T1
    where not exists (select 1 from T2 where a = T1.a and b = T2.b )
      

  4.   

    select * from t1 where cast(a as varchar)+cast(b as varchar)  not in (select cast(a as varchar)+cast(b as varchar) as aa  from t2)
      

  5.   

    select *
    from T1
    where not  exists (select * from T2 where a = T1.a and b = T1.b )
      

  6.   

    select * from t1 bb
    where not exists (select * from t2 where a=bb.a and b=bb.b)