Given a table of Zendesk marketing campaigns and a table of user conversions, write a query to identify the first-touch campaign for each converted user.
Assume each user has at most one conversion record. Include only campaign touches occurring at or before the conversion, and exclude converted users with no qualifying campaign touch.
user_id, conversion_id, first_touch_campaign_id, first_touch_campaign_name, and first_touch_at.user_id ascending. If timestamps tie, choose the lowest campaign ID.| Column | Type | Description |
|---|---|---|
| campaign_idPK | INT | Unique campaign touch identifier |
| user_id | INT | User associated with the campaign touch |
| campaign_name | VARCHAR(150) | Zendesk marketing campaign name |
| touch_at | TIMESTAMP | Timestamp when the user touched the campaign |
| Column | Type | Description |
|---|---|---|
| conversion_idPK | INT | Unique conversion identifier |
| user_id | INT | User who converted |
| converted_at | TIMESTAMP | Timestamp when the user converted |