SELECT max(data_voto), id_foto FROM tabella GROUP BY id_foto