Ver Mensaje Individual
  #10 (permalink)  
Antiguo 04/09/2008, 08:44
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 8 meses
Puntos: 39
Respuesta: eliminar registros

Que distraido que soy.
Cita:
DELETE from SRRUTA2 t1 left join (
select CR2, CR3, CR4, CR5, CR6, CR7
from SRRUTA2
group by CR2, CR3, CR4, CR5, CR6, CR7
having count(1)>1
) t2 on t1.CR2=t2.CR2 and t1.CR3=t2.CR3 and t1.CR4=t2.CR4 and t1.CR5=t2.CR5 and t1.CR6=t2.CR6 and t1.CR7=t2.CR7
where t2.CR2 is null
Faltaba el alias t1.
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.