Split displayed accounts by on- or off-budget
This commit is contained in:
1 parent
04fd687324
commit
f4ddf12214
4 files changed
+41
-14
No files matched your search
@@ -14,7 +14,7 @@ WHERE accounts.budget_id = $1
|
||||
ORDER BY accounts.name;
|
||||
|
||||
-- name: GetAccountsWithBalance :many
|
||||
SELECT accounts.id, accounts.name, SUM(transactions.amount)::decimal(12,2) as balance
|
||||
SELECT accounts.id, accounts.name, accounts.on_budget, SUM(transactions.amount)::decimal(12,2) as balance
|
||||
FROM accounts
|
||||
LEFT JOIN transactions ON transactions.account_id = accounts.id
|
||||
WHERE accounts.budget_id = $1
|
||||
|
||||
Reference in new issue
Block a user