Hacker News new | ask | show | jobs
by zeuch 1483 days ago
Another way is maintaining the final balance field for the readings. Every new transaction you save it into the transactions table and adjust the balance field as well.

You can have a job to go through the transactions from time to time to save important balances that user would need (e.g: daily, monthly and quarterly balances).