Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Consumption from Cumulative Readings

Each reading is a cumulative meter total. Return each meter, reading date and the kWh used since the previous reading (skip the first reading of each meter). Order by meter, then date.

Table schema

Readings(meter_id INT, reading_date DATE, kwh_total INT)

Sample data

Readings
meter_id | reading_date | kwh_total
1 | 2026-01-31 | 1000
1 | 2026-02-28 | 1120
1 | 2026-03-31 | 1180
1 | 2026-04-30 | 1400
2 | 2026-01-31 | 500
2 | 2026-02-28 | 560
2 | 2026-03-31 | 650

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.