Ver Mensaje Individual
  #2  
Antiguo 27-01-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 19.437
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Si la tabla REGISTRE tiene "clave primaria" puedes utilizar un IN. Algo así (te lo pongo sin probar, así que ya dirás si me he dejado algo); Como mínimo te servirá para coger la idea...

(suponiendo por ejemplo que el campo ORDEN_FABRICACION fuera la primary key)

Código SQL [-]
  update registre
  set acabados = "0"
  where ORDEN_FABRICACION IN (
     SELECT TOP 15 REGISTRE.ORDEN_FABRICACION
     FROM REGISTRE
     WHERE (((REGISTRE.ACABADOS) Is Null)))
 ORDER BY REGISTRE.FECHA, REGISTRE.PRIORIDAD

Se trata de usar el SELECT..IN para seleccionar los 15 primeros y luego hacer el update sólo sobre esos.

NOTA: El ORDER BY para el Update no es necesario
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita