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

8 lines
195 B
SQL

DROP VIEW IF EXISTS AvailableCredits;
CREATE VIEW AvailableCredits AS
SELECT credId, account, purpose, date,
value - spent AS difference
FROM Credit
WHERE value != spent
;