Hello Dear Mike,
I think we can also remove duplicates using simplest, easiest and better way without using temp table/s logic:
WITH CTE_InsurancePolicy AS (
SELECT PolicyId, FirstName, Surname, PolicyStartDate, PolicyEndDate
,ROW_NUMBER() OVER (PARTITION...