Write a SQL query to find the second-highest energy consumption record for a specific utility grid sector.
Use the provided sector and consumption tables. Treat the second-highest value as the second distinct non-null consumption level, returning every record tied at that level.
record_id, sector_code, consumption_kwh, and recorded_at.SOUTH_BAY at the second-highest distinct consumption level.consumption_kwh descending, then record_id ascending.| Column | Type | Description |
|---|---|---|
| sector_idPK | INT | Unique utility grid sector identifier |
| sector_code | VARCHAR(30) | Business code for the grid sector |
| sector_name | VARCHAR(100) | Human-readable sector name |
| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique energy consumption record identifier |
| sector_id | INT | Referenced utility grid sector |
| consumption_kwh | DECIMAL(12,2) | Recorded energy consumption in kilowatt-hours |
| recorded_at | TIMESTAMP | Timestamp when consumption was recorded |