Write a SQL query to find duplicate records in a database table containing Axon device logs.
Treat records with the same device_id, event_type, logged_at, and status as duplicates. Exclude the unique log_id from duplicate matching.
device_id, event_type, logged_at, status, and duplicate_countdevice_id, event_type, logged_at, and status ascending, with NULL statuses first| Column | Type | Description |
|---|---|---|
| log_idPK | INTEGER | Unique identifier for the log row |
| device_id | VARCHAR(20) | Axon device identifier |
| event_type | VARCHAR(40) | Type of device event |
| logged_at | TIMESTAMPTZ | Timestamp when the event was logged |
| status | VARCHAR(20) | Processing status of the log event |