AvePoint wants to understand which product features are most used by its most active enterprise customers. Write a PostgreSQL query that considers usage during the 30-day period ending on September 15, 2026, identifies the three most active enterprise accounts, and returns the three most-used features among those accounts.
Output
- Return one row per feature with columns
feature_name and usage_count.
- Include only usage events from August 17, 2026 through September 15, 2026, inclusive. Events with a null or unmatched feature are excluded from feature totals.
- Select the three enterprise accounts with the most usage events in that period. Break account-activity ties by
account_id in ascending order.
- Return at most three features, ordered by
usage_count descending and then feature_name ascending. Return fewer rows when fewer than three matched features exist.