select *
from s1..t1
where s1..t1.ddh not in (
select ddh from s2..t2 )

解决方案 »

  1.   

    select * from t1 where not exists (select 1 from t2 where t1.xh=t2.xh and t1.hh=t2.hh)
      

  2.   

    select * from s1..t1 t1 where not exists (select 1 from s2..t2 where t1.xh=t2.xh and t1.hh=t2.hh)
      

  3.   

    这个是对的select * from s1..t1 t1 where not exists (select 1 from s2..t2 t2 where t1.xh=t2.xh and t1.hh=t2.hh)
      

  4.   

    select *
    from s1..t1
    where t1.ddh not in ( select ddh from s2..t2 )
    and t1.hh not in( select hh from s2..t2 )
      

  5.   

    select * from s1..t1 t1 where not exists (select 1 from s2..t2 t2 where
                                                     ^这个1代表是什么意思啊?
     t1.xh=t2.xh and t1.hh=t2.hh)
      

  6.   

    select * from s1..t1 as 别名1 where not exists (select 1 from s2..t2 别名2 where 别名1.xh=别名2.xh and  别名1.hh=别名2.hh)1是简写,普通是*,字段名,这样就少了返回值