Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/03/2018, 11:16
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: Group By o Join?

Código SQL:
Ver original
  1. SELECT * FROM tabla AS t1
  2. LEFT JOIN
  3. (
  4. SELECT MAX(fecha) AS feca, id FROM tabla GROUP BY id
  5. ) AS t2 ON (t1.fecha=t2.fecha AND t1.id=t2.id)

Also asi
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me