I have a view which calculates rolling sum taking in value form previous row based on PARTITION BY
clause, and I need to indicate one field in PARTITION BY
clause can have nulls in them.
sum(s."QuantityChange") OVER (PARTITION BY s."LocationId", s."PartId", s."SupplierFacilityId" ORDER BY s."DueDate" ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS "RunningSum"
Sometimes SupplierFacilityId
is null and that's fine, it should still be included in the sum()
calculation.
Is this possible with Postgres?