Write a SQL query using window functions to identify the first and last touchpoint of a user's conversion path.
Use the conversion_touchpoints table. Treat an earlier occurred_at as first, and use the lower touchpoint_id to break ties.
user_id, first_touchpoint, and last_touchpoint.user_id ascending.| Column | Type | Description |
|---|---|---|
| touchpoint_idPK | INT | Unique identifier for the touchpoint event |
| user_id | INT | Identifier of the user whose path contains the event |
| touchpoint | VARCHAR(100) | Marketing or product touchpoint associated with the event |
| occurred_at | TIMESTAMP | Timestamp when the touchpoint occurred |