1: 2: 3:
select * from (select *,dense_rank() over ( partition by Customer order by Date desc) as RN from #tst ) as t1 where t1.RN = 1