treasuredb/schema/views/02_CurrentArrears.sql
2017-01-23 19:08:04 +01:00

12 lines
245 B
SQL

DROP VIEW IF EXISTS CurrentArrears;
CREATE VIEW CurrentArrears AS
SELECT billId,
debtor,
targetCredit,
purpose,
date,
value - paid AS difference
FROM Debit
WHERE value != paid
;