From: | database2003(at)Argentina(dot)com |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | [OT] SQL complicado solucion |
Date: | 2004-08-26 13:41:19 |
Message-ID: | 412DE56500000121@webmail.argentina.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Esta es la sulucion a mi problema, por si a alguno le interesó, me la mando
Liliana Sorrentino del foro www.PortalSQL.com
(es otra tabla pero esa es la solucion)
////
Enviado por :lsorrentino(at)mardelplata(dot)gov(dot)ar
SELECT t1.idvehiculo, t1.idtranportista, maxima, t1.nombreVehic
FROM tabla t1
INNER JOIN
(SELECT idvehiculo, idtranportista, maxima = MAX(fechaalta) FROM tabla GROUP
BY idvehiculo, idtranportista) t2
ON t1.idvehiculo = t2.idvehiculo AND t1.idtranportista = t2.idtranportista
AND t1.fechaalta = t2.maxima
Liliana.
/////
Gracias Liliana y a Uds tambien por interesarse.
Julio.
---
E-mail y acceso a Internet UltraVeloz totalmente GRATIS en 25 ciudades,
Nro. de acceso 5500-5500 Usuario: Argentina Password: Argentina
http://www.Argentina.com
From | Date | Subject | |
---|---|---|---|
Next Message | eduardo cifuentes | 2004-08-26 13:43:52 | Funciones en PLPGSQL |
Previous Message | Roberto C. Farías | 2004-08-26 00:26:56 | pregunta sobre postgresql 8.0 para windows |