sql 语句查询出来的值 在a表里面不错在。select *  from b where b.code not in (select code from a)问题: 如果3个字段(code,linecode,name)才能判断在a 表里面不存在该怎么写???
select *  from b  where (select code,linecode,name  NOT IN (SELECT code,linecode,name  FROM b))

解决方案 »

  1.   

    b=a(+) 选择a表都为空的项,或者慢慢and ** not in (selectment)and ** not in (selectment)
      

  2.   

    select *  from b where exits(select 1 from a where a.code= b.code and a.linecode = b.linecode and a.name= b.name)
      

  3.   

    select *  from b where not exits(select 1 from a where a.code= b.code and a.linecode = b.linecode and a.name= b.name)