How to delete duplicate rows without unique identifier

I like @erwin-brandstetter ‘s solution, but wanted to show a solution with the USING keyword: DELETE FROM table_with_dups T1 USING table_with_dups T2 WHERE T1.ctid < T2.ctid — delete the “older” ones AND T1.name = T2.name — list columns that define duplicates AND T1.address = T2.address AND T1.zipcode = T2.zipcode; If you want to review the … Read more