Subject Re: [ib-support] A Gotcha with SELECT FIRST
Author Helen Borrie
At 05:03 PM 01-05-02 +0200, you wrote:
>from Release Notes v.1.0.1:
>
>"
>A Gotcha with SELECT FIRST
>This
>
>delete from TAB1 where PK1 in (select first 10 PK1 from TAB1);
>
>will delete all of the rows in the table. Ouch! the sub-select is
>evaluating each 10 candidate rows for deletion, deleting them, slipping
>forward 10 more...ad infinitum, until there are no rows left. Beware!
>"
>
>Question: what is PK1 ?

Just a column name.
"delete from rosegarden where roses in (select first 10 roses from TAB1);"
would smell as sweet.
;-)
H.

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________