Write a SQL query to find the top 3 most active users per product feature over the last 30 days.
Use the users, product_features, and feature_events tables. Activity is measured by the number of feature events during the rolling 30-day period ending today.
Output
- One row per qualifying user and product feature.
- Include
feature_id, feature_name, user_id, user_name, activity_count, and activity_rank.
- Return no more than three users per feature, ordered by
feature_id, then rank, with lower user_id breaking activity ties.