Subject RE: Help with a DELETE command
Author Robert DiFalco
Ugh. Ok, so this actually worked. It's just that it was SOOOOO slow on
the DELETE that I thought the server had hung.

Well I tried taking out the DELETE part of the equation. Performing a
SELECT with this JOIN take just a few milliseconds to execute while.
Performing a SELECT with this sub-select takes around 12 minutes.

Too bad I can't do joins in delete statements, huh?


-----Original Message-----
From: Robert DiFalco
Sent: Sunday, December 05, 2004 1:05 PM
To: 'firebird-support@yahoogroups.com'
Subject: Help with a DELETE command

Without using ON DELETE or Triggers, how can I best do the following?

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?

Btw, this is FB 1.0.3 on Windows.