1 CREATE OR REPLACE VIEW yearsummary AS
2 SELECT entitytype, entitycode, accountcode
3 , sum(balance) AS balance
5 FROM accountbalance LEFT JOIN month USING (monthcode)
6 GROUP BY entitytype, entitycode, accountcode, financialyearcode;
8 GRANT SELECT ON yearsummary TO general;