>Assuming you want to keep the first entry:
>
>
>;with cte as (select PK, row_number() over (partition by all these fields order by DateFld) as Rn from Client)
>
>delete from cte where Rn > 1
>
>
>This will keep the row with the first date. You can pick any other column in the order by and if you don't care which row to keep you can use
>
>ORDER BY (select 0)
It is not clear how I should integrate this cte syntax into the original SQL. Could you just show me an example? Thanks