Introduce own Numeric type and revert to stdlib from pgx
This commit is contained in:
@ -5,7 +5,13 @@ VALUES ($1, $2)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetAccounts :many
|
||||
SELECT accounts.id, accounts.name, SUM(transactions.amount) as balance FROM accounts
|
||||
SELECT accounts.* FROM accounts
|
||||
WHERE accounts.budget_id = $1;
|
||||
|
||||
-- name: GetAccountsWithBalance :many
|
||||
SELECT accounts.id, accounts.name, SUM(transactions.amount)::decimal(12,2) as balance
|
||||
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;
|
Reference in New Issue
Block a user