Introduce own Numeric type and revert to stdlib from pgx
This commit is contained in:
1 parent
6f8a94ff5d
commit
4646356b2d
16 files changed
+136
-57
No files matched your search
@@ -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