Write a query to find duplicate records in a table based on a specific column, and explain how you would delete them.
Use customer_accounts and treat email as the column that must be unique. Keep the record with the smallest id, exclude NULL emails from duplicate detection, and explain how to delete only the later duplicate records.
duplicate_id, email, created_at, and duplicate_count.email ascending, then duplicate_id ascending.| Column | Type | Description |
|---|---|---|
| idPK | INTEGER | Unique account record identifier |
| VARCHAR(255) | Email value used to identify duplicates | |
| created_at | TIMESTAMP | Time when the account record was created |