Prueba lo siguiente:
update bibli2.fichero
set campo4 = 'PRUEBA'
where
(campo1 || campo2 || campo3) in
��� ( select (bibli2.fichero.campo1 || bibli2.fichero.campo2
|| bibli2.fichero.campo3)
FROM
bibli2.fichero,
bibli1.fichero
where
bibli1.fichero.campo1
= bibli2.fichero.campo1 and
bibli2.fichero.campo2 = bibli1.fichero.campo2 and
bibli2.fichero.campo3= bibli1.fichero.campo3 and
bibli2.fichero.campo4 = 'PRUIYD')
Joan
De: Pinedo
Pedro [mailto:[EMAIL PROTECTED]
Enviado el: viernes 21 de enero de
2005 10:44
Para: [email protected]
Asunto: Optimizar sql
Soy un "tomate" con esto del sql. He montado esta
sentencia para actualizar un campo de registros coincidentes entre dos ficheros
de distintas biblioteca, pero el rendimiento es penoso.
�Alguien me puede ayudar?
update bibli2.fichero
set campo4 = 'PRUEBA'
where
campo1 in( select bibli2.fichero.campo1
FROM
bibli2.fichero,
bibli1.fichero
where
bibli1.fichero.campo1
= bibli2.fichero.campo1 and
bibli2.fichero.campo2 = bibli1.fichero.campo2 and
bibli2.fichero.campo3= bibli1.fichero.campo3 and
bibli2.fichero.campo4 = 'PRUIYD')
and
campo2 in( select bibli2.fichero.campo2
FROM
bibli2.fichero,
bibli1.fichero
where
bibli1.fichero.campo1 = bibli2.fichero.campo1 and
bibli2.fichero.campo2 = bibli1.fichero.campo2 and
bibli2.fichero.campo3= bibli1.fichero.campo3 and
bibli2.fichero.campo4 = 'PRUIYD')
and
campo3 in( select bibli2.fichero.campo3
FROM
bibli2.fichero,
bibli1.fichero
where
bibli1.fichero.campo1 =
bibli2.fichero.campo1 and
bibli2.fichero.campo2
= bibli1.fichero.campo2 and
bibli2.fichero.campo3= bibli1.fichero.campo3 and
bibli2.fichero.campo4
= 'PRUIYD')
Pedro
Pinedo Hernandez
Analista-Programador
Grupo
Amcor Flexibles Hispania S.L.
Planta: Tobepal Logro�o
Departamento de Inform�tica / IT Department
tfno.:+34 941 28 60 90 - 941 03 01 39
fax: +34 941 20 75 43
26006 Logro�o
Spain
[EMAIL PROTECTED]
(quitar
nospam del dominio, para enviar)
_______________________________________________________
AMCOR FLEXIBLES - LEADING THROUGH INNOVATION
_______________________________________________________
CAUTION - This message may contain privileged and confidential information
intended only for the use of the addressee named above. If you are not the
intended recipient of this message you are hereby notified that any use,
dissemination, distribution or reproduction of this message is prohibited. If
you have received this message in error please notify AMCOR FLEXIBLES
immediately. Any views expressed in this message are those of the individual
sender and may not necessarily reflect the views of AMCOR FLEXIBLES.