Write a SQL query to calculate the month-over-month retention rate of users who interacted with an AR lens on Snapchat.
Assume retention for a month means the percentage of users active in the previous month who were also active in the current month. Include only valid users and lenses identified as AR lenses.
Output
- One row per month with a previous month of AR lens activity
- Columns:
month, active_users, retained_users, and retention_rate
active_users is the prior month's user count, and retained_users is the count active in both months
- Return
retention_rate as a percentage rounded to two decimals, ordered chronologically