Postgresql – Query to sum over multiple rows based on column
I have a table with monthly amounts per ID, where in some of these months an invoice takes place. My table looks like: ID Date Invoiced Amount AAA 2023-01 0 10 AAA 2023-02 0 15 AAA 2023-03 1 15 AAA…