Begin hiermee:
select StudentId, max(DateApproved)
from tbl
group by StudentId
Integreer dat dan in de hoofdquery:
select *
from tbl
where (StudentId, DateApproved) in
(
select StudentId, max(DateApproved)
from tbl
group by StudentId
)
Je kunt dit ook gebruiken:
select *
from tbl
join (select StudentId, max(DateApproved) as DateApproved
from tbl
group by StudentId)
using (StudentId, DateApproved)
Maar ik geef de voorkeur aan tuple-testen, het is een manier van netter
Live-test:http://www.sqlfiddle.com/#!2/771b8/ 5