Write a SQL query to compare current performance against a prior period using window functions.
Use the supplied monthly performance data. Return only periods that have a prior period for the same location, while retaining rows where the current revenue is NULL.
location, performance_month, current_revenue, prior_revenue, revenue_change, and revenue_change_pctlocation, then performance_month ascending| Column | Type | Description |
|---|---|---|
| performance_idPK | INT | Unique monthly performance record identifier |
| location | VARCHAR(100) | SIXT rental location |
| performance_month | DATE | First day of the reported month |
| revenue | DECIMAL(12,2) | Revenue recorded for the location and month |