select a.* from a left b on a.id=b.id
where d.id is null

解决方案 »

  1.   

    有点错
    select a.* from a left b on a.id=b.id
    where b.id is null
    or
    select * from a where not exists(select top 1 1 from b where a.id=id)
    or
    select * from a where in not in(select id from b)
      

  2.   

    Select a.* from a,b where a.字段 not in (b.字段)
      

  3.   

    Select a.* from a,b where a.字段<>b.字段
      

  4.   

    select * from a where 字段 not in (select 字段 from b)
      

  5.   

    select * from a where id not in(select id from b)
    or 
    select a.* from a,b where a.id<>b.id
      

  6.   

    Select a.* from a,b where a.字段<>b.字段
      

  7.   

    select a.* from a where a.id not in (select b.id from b)