treasuredb/schema/views/02_CurrentArrears.sql

12 lines
245 B
MySQL
Raw Normal View History

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