Top 3 vendors by city and state in the last 2 years

Using the same transactions and vendors tables, write a SQL query to:

Within the last 2 years, group by state and city, compute each vendor’s net amount (PURCHASE positive, REFUND negative), ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: