Display accounts sorted by name
This commit is contained in:
@ -10,7 +10,8 @@ WHERE accounts.id = $1;
|
||||
|
||||
-- name: GetAccounts :many
|
||||
SELECT accounts.* FROM accounts
|
||||
WHERE accounts.budget_id = $1;
|
||||
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
|
||||
@ -18,4 +19,5 @@ FROM accounts
|
||||
LEFT JOIN transactions ON transactions.account_id = accounts.id
|
||||
WHERE accounts.budget_id = $1
|
||||
AND transactions.date < NOW()
|
||||
GROUP BY accounts.id, accounts.name;
|
||||
GROUP BY accounts.id, accounts.name
|
||||
ORDER BY accounts.name;
|
Reference in New Issue
Block a user