Ver Mensaje Individual
  #1  
Antiguo 08-11-2005
Abel Garcia Abel Garcia is offline
Miembro
 
Registrado: nov 2004
Posts: 45
Reputación: 0
Abel Garcia Va por buen camino
Lightbulb Borrar n Registros de una Tabla

Hola, Tengo una duda que en primera instancia pareseria sencilla pero no he encontrado como hacerlo, la idea seria borrar los primeros n registros de una tabla esto usando Firebird 1.5 , el problema es que me encontre un parrafo en el documento Firebird 1.5 Relese notes donde afirma que la siguiente posible intruccion que podria llegar ha hacer esto tendria el siguiente problema:

Two Gotchas with SELECT FIRST
1. 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.
y si efectivamente si ejecutas la instruccion no solo borra los 10 primero como pudieras esperar, sin no que borra todos los registros:
Alguien mas Tiene un idea de como hacer esto ?

Muchas gracias por su ayuda
Responder Con Cita