codice:
SELECT id_anagra,MAX(data_fine) AS massimo FROM tabella
GROUP BY id_anagra;