Given a list of records with user_id and event_time, write a query to keep only the latest record per user.
Use the records table. When a user has multiple records at the same latest timestamp, retain the record with the greatest record_id. Treat non-null timestamps as more recent than null timestamps.
record_id, user_id, and event_time.user_id ascending.| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique identifier for the record |
| user_id | INT | Identifier of the user associated with the record |
| event_time | TIMESTAMP | Time when the user event occurred |