Current and previous days date diff in days with some condition – Postgresql
I have the first three fields of the following table. I want to compute the number of consecutive days an amount was higher than 0 ("days" field). key date amount days 1 2023-01-23 0 0 1 2023-01-22 10 2 1…