问题 I am trying to delete duplicates in Postgres. I am using this as the base of my query: DELETE FROM case_file as p WHERE EXISTS ( SELECT FROM case_file as p1 WHERE p1.serial_no = p.serial_no AND p1.cfh_status_dt < p.cfh_status_dt ); It works well, except that when the dates cfh_status_dt are equal then neither of the records are removed. For rows that have the same serial_no and the date is the same, I would like to keep the one that has a registration_no (if any do, this column also has NULLS