Anda sepertinya hanya ingin:
Select . . .
COALESCE(SUM(d.paid_amt) OVER (PARTITION BY c.field04), 0) as amount_paid
Anda sepertinya hanya ingin:
Select . . .
COALESCE(SUM(d.paid_amt) OVER (PARTITION BY c.field04), 0) as amount_paid