问题:
表一结构 
  VersionId            int                  not null, 
  MCellId              nvarchar(64)        not null, 
  NCellId              nvarchar(64)        not null, 
  AccordNoise          decimal              null, 
表二结构 
  VersionId            integer            not null, 
  MCellId              nvarchar(64)        not null, 
  NCellId              nvarchar(64)        not null, 我想做到的是:表一中AccordNoise > 0.05 而表一中MCellId和NCellId的一对值又在表二中没有的一个结果
和 AccordNoise < 0.0001 而表一中MCellId和NCellId的一对值又在表二中没有的一个结果的合集望各位大侠指点

解决方案 »

  1.   

    最终要查的字段是MCellId和NCellId意思就是两种情况的一个合集,根据条件肯定是不能用同一个条件关系来做,因为是同一个字段的数据两端应该是用联合吧,但具体详细原理,还望解释下
      

  2.   

    select MCellId, NCellId
    from table1
    where AccordNoise > 0.05 or AccordNoise < 0.0001
    except
    select MCellId, NCellId
    from table2
      

  3.   

    select MCellId, NCellId 
    from table1 
    where (AccordNoise > 0.05 or AccordNoise < 0.0001 )
    and MCellId not in(select MCellId from table2) and NCellId  not in(select NCellId  form table2)