delete from A where field1 not in(select DISTINCT isnull(field1,'') from B)

解决方案 »

  1.   

    delete A  where field1 not in(select DISTINCT field1 from B)
      

  2.   

    DELETE FROM A WHERE NOT EXISTS(SELECT * FROM B WHERE A.FIELD1=B.FIELD1 )
      

  3.   

    delete from A where field1 not in(select DISTINCT field1 from B)
    语句看上去没错,有没有DISTINCT没关系。
      

  4.   

    删除之前先select 一下select * from A where field1 not in(select DISTINCT field1 from B)
    看看到底有没有
      

  5.   

    同意sky_blue(老衲)的意见,这样比较保险
      

  6.   

    to Chiff(~o~):
        谢谢,根据你写的调试通过了,但是有一个问题,
        为什嬷是NULL的时候就上不到呢?
      

  7.   

    如果not in后的结果集中有null值,则该条件恒为成立。
      

  8.   

    sorry,
    如果not in后的结果集中有null值,则该条件恒为不成立。