I connect two tables **tbl_agro_exploatare**tbl_agro_works**ID.tbl_agro_work**ID**tbl_agro_works**MaxDate
On the contrary I receive first ID value of the records with same **EXPLOATARE_ID.
How I can fix the problem?
`SELECT TAE.PARCELA_ID, TAE.CAMPANIA_ID, TAW.MaxDate, TAW.ID AS TAWID FROM tbl_agro_exploatare TAE
LEFT JOIN
(select EXPLOATARE_ID, ID, max(TARIH) as MaxDate from tbl_agro_works
GROUP BY EXPLOATARE_ID) TAW on TAW.EXPLOATARE_ID = TAE.ID