Ultimate access to all questions.
You have a Delta Lake table named customer_purchases
with duplicate records based on customer_id
. Your goal is to deduplicate these records by retaining only the latest purchase record for each customer, determined by purchase_date
. How would you use the MERGE statement in Databricks SQL to accomplish this task?