delete from a where
a.id not in (select outId from ) 
如何转换left join  (类似elete a from a left join b on a.id=b.outid where b.outid is null)
现在这个语句需要加很多的限制条件
甚至还有关联另外1表, 现仅仅要加1个限制条件
如何转?

解决方案 »

  1.   

    delete a from a left join b on a.id=b.id where b.id is null and  a.id>1000
    当您的问题得到解答后请及时结贴.
    http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
      

  2.   

    delete a 
    from a 
    left join b 
    on a.id=b.outid 
    where b.outid is null
    and ...
    and ...
     
      

  3.   

    delete a from a left join b on a.id=b.outid where b.outid is null and 其他条件 and 其他条件....
      

  4.   

    delete a from a left join b on a.id=b.id where b.id is null and  a.id>1000 and .....