Insight Global needs a quarterly billing report for client leadership. Assume the reporting date is July 15, 2025, so the last completed quarter is April 1 through June 30, 2025.
Write a PostgreSQL query to identify the top three highest-billing clients within each region.
Requirements
- Join
invoices to clients and regions.
- Include only invoices from the last completed quarter, using an inclusive start date and exclusive end date.
- Aggregate invoice amounts by client and region.
- Rank clients within each region and return no more than three clients per region, ordered by region and billing amount descending.