create view vi_overdue_rent_plan_sum as SELECT VI_OVERDUE_RENT_PLAN.CONTRACT_ID                 AS CONTRACT_ID,
       count(VI_OVERDUE_RENT_PLAN.PLAN_LIST)            AS OVER_LIST,
       max(VI_OVERDUE_RENT_PLAN.OVERDUE_DAYS)           AS OVER_DAYS,
       round(sum(VI_OVERDUE_RENT_PLAN.OVERDUERENT), 2)  AS OVER_MONEY,
       round(sum(VI_OVERDUE_RENT_PLAN.PENALTY), 2)      AS OVER_PENALTY,
       round(sum(VI_OVERDUE_RENT_PLAN.OVERINTEREST), 2) AS OVER_INTEREST
FROM APZL.VI_OVERDUE_RENT_PLAN
WHERE (VI_OVERDUE_RENT_PLAN.OVERDUERENT > 0)
GROUP BY VI_OVERDUE_RENT_PLAN.CONTRACT_ID;

-- comment on column vi_overdue_rent_plan_sum.contract_id not supported: 合同编号

