I have wrecked my brain on this problem for quite some time. I\'ve also reviewed other questions but was unsuccessful.
The problem I have is, I have a list of results/t
You want embedded queries, which not all SQLs support. In t-sql you'd have something like
select r.registration, r.recent, t.id, t.unittype
from (
select registration, max([date]) recent
from @tmp
group by
registration
) r
left outer join
@tmp t
on r.recent = t.[date]
and r.registration = t.registration