Subject | A Gotcha with SELECT FIRST |
---|---|
Author | Duilio Foschi |
Post date | 2002-05-01T15:03:04Z |
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 ?
TIA
Duilio Foschi
"
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 ?
TIA
Duilio Foschi