treasuredb/schema/views/01_AvailableCredits.sql

8 lines
195 B
MySQL
Raw Normal View History

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