Write a SQL query to join two tables and return the latest record per user.
Return every user, including users without a record. Treat the greatest recorded_at value as latest, and use the greatest record_id to break timestamp ties.
user_id ascendinguser_id, user_name, record_id, recorded_at, and status| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique identifier for the user |
| user_name | VARCHAR(100) | Display name of the user |
| VARCHAR(255) | User email address |
| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique identifier for the record |
| user_id | INT | User associated with the record |
| recorded_at | TIMESTAMP | Timestamp when the record was created |
| status | VARCHAR(30) | Status stored in the record |