Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/07/2008, 17:27
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 19 años, 6 meses
Puntos: 39
Respuesta: SELECT sin subconsultas

Asi no te funciona?
Código:
SELECT C.Cuenta, C.Nombre, MAX(G.[Fecha Gestion]) [ULT_FCH_GEST],
    MAX(P.[Fecha Pago]) [ULT_FCH_PAGO], MAX(P.Valor) [VALOR_ULT_PAGO]
FROM CLIENTES C
    INNER JOIN GESTIONES G ON C.Cuenta=G.Cuenta
    INNER JOIN PAGOS P ON C.Cuenta=P.Cuenta
GROUP BY C.Cuenta, C.Nombre
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.