Subject | Re: [firebird-support] Help with a DELETE command |
---|---|
Author | Helen Borrie |
Post date | 2004-12-05T21:55:29Z |
At 01:04 PM 5/12/2004 -0800, you wrote:
WHERE EXISTS(
SELECT 1 FROM Parent p
WHERE p.F_CHILD_ID = c.F_ID AND p.F_FOO = 1)
./hb
>Without using ON DELETE or Triggers, how can I best do the following?DELETE FROM Child c
>
> DELETE
> FROM Child JOIN Parent ON Child.F_ID = Parent.F_CHILD_ID
> WHERE Parent.F_FOO = 1;
>
>I know the above is illegal, but it captures the query I would like to
>delete with. I tried the following but for some reason it locked up the
>database completely -- not even an error message:
>
> DELETE
> FROM Child
> WHERE Child.F_ID
> IN (SELECT Parent.F_CHILD_ID FROM Parent WHERE
>Parent.F_FOO = 1);
>
>Any thoughts?
WHERE EXISTS(
SELECT 1 FROM Parent p
WHERE p.F_CHILD_ID = c.F_ID AND p.F_FOO = 1)
./hb