Subject | Re: Help with a DELETE command |
---|---|
Author | robert_difalco |
Post date | 2004-12-06T19:58:29Z |
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
rset = exec( "SELECT ChildID FROM Parent WHERE Foo = some_num" );
while ( rset.next() )
exec( "DELETE FROM Child WHERE Id = " + rset.getLong( 1 ) );
Orders of magnitutede faster than this:
DELETE FROM Child
WHERE Id IN( SELECT ChildID FROM Parent WHERE Foo = some_num );
???
TIA,
R.
<aharrison@i...> wrote:
> That statement is not just illegal, it's ambiguous. Do youUnderstood. FWIW, why is this:
> delete the qualifying rows from PARENT, CHILD or both? Under
> the rules of an inner join, CHILD join PARENT on <condition>
> is the same as PARENT join CHILD on <condition>.
rset = exec( "SELECT ChildID FROM Parent WHERE Foo = some_num" );
while ( rset.next() )
exec( "DELETE FROM Child WHERE Id = " + rset.getLong( 1 ) );
Orders of magnitutede faster than this:
DELETE FROM Child
WHERE Id IN( SELECT ChildID FROM Parent WHERE Foo = some_num );
???
TIA,
R.