Subject Re: [ib-support] Delete * with child fields.
Author Ann W. Harrison
At 04:20 PM 2/20/2001 -0300, Carlos H. Cantu wrote:
>Someone posted this on my discussion group :
>
>Is there a way to delete all the records on a table who actually dont have
>any child on other table (with FK defined) and keep the others out of the
>delete ?

Something like

delete from whatever
where not any (select child_id from children
where children.parent = whatever.id)

?


Regards,

Ann
www.ibphoenix.com
We have answers.