2011-02-01 22 views

回答

3
delete from parent 
where a < 10 
     and not exists (select * from child where parent.id = child.parent_id) 
+0

非常感谢! :) – 2011-02-02 16:18:32

0

做的另一种方式:

delete from parent 
where a < 10 
and id not in (select parent_id from child, parent b where child.parent_id = b.id) 
相关问题