Subject Re: [firebird-support] Re: SQL question: bug or feature?
Author Ann W. Harrison
At 01:03 PM 10/26/2004, sserdyuk_05446 wrote:

>You are right, it is better this way, but it doesn't change results-
>still one record did not get deleted.
>Any other ideas?
> > Neither. The search field should be qualified:
> >
> > delete from SY_REPORT_WRITER_REPORTS t1
> > where t1.NBR in
> > (select t2.NBR from SY_REPORT_WRITER_REPORTS t2
> > where t2.ACTIVE_RECORD='N')
> >

Sigh. The "in" expression is being computed for each record
rather than once for the whole delete. Once the two records
with "ACTIVE RECORD = N" are deleted, nothing else matches.
There are a variety of work arounds.