Ver originalSELECT * FROM tabla1 AS t1LEFT JOIN (SELECT MAX(fecha) AS fecha,id FROM tabla2 GROUP BY id) AS t2 ON (t1.id=t2.id AND t1.fecha=t2.fecha)