For CRM app … I’m looking for a piece of SQL code that will enable me to eliminate duplicate records in a database using a key (like CUSTOMER_ID) with the added twist of a sort criteria (like keeping the most recent CONTACT_DATE records for each customer).