I have a query SELECT * from TABLE
which gives the result as below table:
Expected column is as below:
I want to frame a new column like whenever we get the value as 0
then the number should be incremented by 1
. I tried DENSE_RANK()
, ROW_NUMBER()
but couldn't get the exact result which mentioned. Is that possible in PostgreSQL.