Skip to content

Commit

Permalink
fix: add select
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jan 27, 2025
1 parent 63c692c commit 54e0b70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/datastore/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2498,8 +2498,9 @@ export class PgStore extends BasePgStore {
WHERE pruned = false AND token_transfer_recipient_address = ${principal}
),
values AS (
COALESCE((SELECT total FROM received), 0) AS inbound,
COALESCE((SELECT total FROM sent), 0) + COALESCE((SELECT total FROM sponsored), 0) AS outbound
SELECT
COALESCE((SELECT total FROM received), 0) AS inbound,
COALESCE((SELECT total FROM sent), 0) + COALESCE((SELECT total FROM sponsored), 0) AS outbound
)
SELECT inbound, outbound, (inbound - outbound) AS delta
`;
Expand Down

0 comments on commit 54e0b70

Please sign in to comment.