se non hai altri dati da estrarre prova con:

codice:
select tipo, max(data), matricola
from tabella
where tipo = 'P'
group by matricola