Create a CTE that has a ROW_NUMBER column, and then select rows where that column = 1 ROW_NUMBER() = 1
WITH src AS (
select
z.country,
z.city,
z.state,
z.Country,
z.GeogCol1,
z.GeogColTemp,
z.zipcode,
l.data_date,
l.loan,
l.mtgrlastname,
l.mtgrfirstname,
l.propertystreetnum,
l.propertydirection,
l.propertystreet,
l.cityname,
l.propertystate,
ROW_NUMBER() OVER (PARTITION BY l.propertynumber, l.propertystreet,...