Write a SQL query to calculate the month-over-month retention rate of users acquired through paid search campaigns at Retool.
Use the provided campaign, user, and activity data. Include monthly transitions where users were active in the preceding month, including transitions with zero retained users.
Output
- One row per consecutive month transition
- Columns:
previous_month, retention_month, previous_active_users, retained_users, and retention_rate
- Include only users acquired through paid search and activity on or after acquisition
- Order by
previous_month ascending