Write a SQL query to find the top three vendor payments by volume for each month.
Treat volume as the total payment amount per vendor per calendar month. Include only payments linked to a vendor record. Break ties by vendor_id in ascending order.
payment_month, vendor_id, vendor_name, total_payment_volume, and monthly_rank.payment_month ascending, then monthly_rank ascending.| Column | Type | Description |
|---|---|---|
| vendor_idPK | INT | Unique vendor identifier |
| vendor_name | VARCHAR(120) | Vendor's display name |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| vendor_id | INT | Vendor associated with the payment |
| payment_date | DATE | Date the payment was issued |
| amount | NUMERIC(12,2) | Payment amount |