U kunt row_number
. gebruiken om de rijen met de hoogste datum per waarde te selecteren
select * from (
select t2.id2, t1.date, t2.data,
row_number() over (partition by t2.data order by t1.date desc) rn
from table1 t1
join table2 t2 on t1.id = t2.id2
) t where rn = 1