Convert table data into a ledger format using PostgreSQL query
I have the following data in a PostgreSQL table: id amount opening_amount closing_amount 1 200 1000 1200 2 -500 NULL NULL 3 -200 NULL NULL 4 1000 NULL NULL I want to convert this data into a ledger format, calculating…