delete b where status='1' and AUNID not in (select AUNID from table_name);

解决方案 »

  1.   

    delete from b where status='1'
    --你的主键和外键对此没有什么影响
      

  2.   

    如果单单删除status=1的记录.delete from b where status=1就行了.
      

  3.   

    删除 A中的记录,A的status=1
      

  4.   

    删除A中的 符合条件 A的子表B的status =‘1’ 的记录
      

  5.   

    delete from a where a.unid in (select b.unid from b where b.status='1')