Write a SQL query to find the email open rate by campaign and identify campaigns with the largest drop over time.
Use the provided campaign, email send, and email event data. Treat a send as opened when it has at least one matching event with event_type = 'open'. Report campaigns with at least one decline between consecutive months.
Output
- One row per campaign and its largest month-over-month decline
- Columns:
campaign_id, campaign_name, from_month, to_month, prior_open_rate, current_open_rate, drop_percentage
- Include only positive declines, ordered by
drop_percentage descending, then campaign_id ascending