Zoox's procurement team wants to identify the vendors with the highest total charges over the most recent two-year period. Write a PostgreSQL query using the current date as the end of the period.
CURRENT_DATE - INTERVAL '2 years' through CURRENT_DATE.vendor_id as a deterministic tie-breaker.vendors.| Column | Type | Description |
|---|---|---|
| vendor_idPK | INTEGER | Unique vendor identifier |
| vendor_name | VARCHAR(150) | Vendor's business name |
| Column | Type | Description |
|---|---|---|
| charge_idPK | INTEGER | Unique charge identifier |
| vendor_id | INTEGER | Vendor associated with the charge |
| charge_date | DATE | Date the charge was recorded |
| amount | NUMERIC(12,2) | Dollar amount of the charge |