Write a query to identify duplicate claim entries at Sedgwick based on a combination of claimant ID, date of injury, and claim type, keeping only the most recent record.
Use the sedgwick_claims table. Treat records with the same three identifying fields as duplicates, and use recorded_at to determine recency.
duplicate_count.claim_id, claimant_id, date_of_injury, claim_type, recorded_at, and duplicate_count.claimant_id, date_of_injury, and claim_type.| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique identifier for the claim record |
| claimant_id | INT | Identifier of the claimant |
| date_of_injury | DATE | Date the injury occurred |
| claim_type | VARCHAR(50) | Classification of the claim |
| recorded_at | TIMESTAMP | Timestamp when the claim record was recorded or updated |