For each account and each date on which expenses were recorded for it, show the expense amount for that day and the cumulative amount of posted expenses from the start of recordkeeping through that date, inclusive. Include only records with status posted; do not include records with other statuses, including NULL. Do not show accounts without posted expenses.
Columns: account_id, account_name, booked_on, daily_posted_cents, running_total_cents
Sort by account_id, then by booked_on in ascending order.
PostgreSQL 17; the query is run in a browser.
Starting PostgreSQL…
Starting PostgreSQL…