On Facebook, analysts often need to measure how long each user has been active within an event log. Write a SQL query to find the time between each user's first and last recorded action.
user_id.action_time.time_between_actions.INTERVAL '0 seconds'.user_id ascending.| Column | Type | Description |
|---|---|---|
| action_idPK | INT | Unique action event ID |
| user_id | INT | Facebook user identifier |
| action_type | VARCHAR(50) | Type of action performed |
| action_time | TIMESTAMP | Timestamp of the action |
| device | VARCHAR(20) | Device used for the action |