Postgresql – delete duplicates based on a combination of 2 columns
I consider a row duplicate when the combination of hash_key and load_date is repeating. I can find such rows using this CTE: with w_duplicated_rows as ( select hash_key, load_date, count(*), --row_number() over (partition by hash_key, load_date order by load_date desc)…