Ver Mensaje Individual
  #5  
Antiguo 15-12-2009
Avatar de Axel_Tech
Axel_Tech Axel_Tech is offline
Miembro
 
Registrado: nov 2008
Ubicación: lugar en que está ubicado algo.
Posts: 85
Reputación: 16
Axel_Tech Va por buen camino
También puedes sustituir el primer IN por un EXISTS, que funciona mucho más rápido:
Código SQL [-]
select * from creditos A where exists
(select idcredito from cuotascreditos B
where idestadocuota in(4,7) and A.idcredito=B.idcredito
group by idcredito having count(*) >= 3)
__________________
No hope, no dreams, no love, my only escape is Underground
Responder Con Cita