For each vessel, show every refueling and the cumulative sum of confirmed expenses in cents from the beginning of the log. Do not omit refuelings with unknown costs; if there are no confirmed expenses yet, the cumulative amount is 0.
Columns: vessel_name, refuel_id, refueled_on, charge_cents, cumulative_charge_cents
Sort: by vessel name, refueling date, and refueling ID in ascending order.
PostgreSQL 17; the query is run in a browser.
Starting PostgreSQL…
Starting PostgreSQL…