Subject Re: [firebird-support] SQL question: bug or feature?
Author Helen Borrie
At 03:20 PM 26/10/2004 +0000, you wrote:



>Hi!
>
>I have a SY_REPORT_WRITER_REPORTS table that loosely looks like:
>
>NBR STATE
>1 'C'
>2 'P'
>2 'N'
>3 'N'
>
>I run:
>
>delete from SY_REPORT_WRITER_REPORTS t1 where t1.NBR in (select
>t2.NBR from SY_REPORT_WRITER_REPORTS t2 where ACTIVE_RECORD='N')
>
>After that data looks like:
>NBR STATE
>1 'C'
>2 'P'
>
>It looks like a huge bug to me. Or is it a feature?

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')

./hb