Skip to content

Commit

Permalink
improved formatting of query
Browse files Browse the repository at this point in the history
  • Loading branch information
oskar-van-rest committed May 29, 2024
1 parent 173b58a commit 16baa72
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ Or, using PGQL with SQL Standard syntax:

```sql
SELECT account_holder, SUM(amount) AS total_transacted_with_Nikita
FROM
GRAPH_TABLE ( financial_transactions
MATCH
(p IS Person) <-[IS owner]- (account1 IS Account),
(account1) -[t IS transaction]- (account2), /* match both incoming and outgoing transactions */
(account2 IS Account) -[IS owner]-> (owner IS Person|Company)
WHERE p.name = 'Nikita'
COLUMNS ( owner.name AS account_holder, t.amount )
)
FROM GRAPH_TABLE ( financial_transactions
MATCH (p IS Person) <-[IS owner]- (account1 IS Account),
(account1) -[t IS transaction]- (account2), /* match both incoming and outgoing transactions */
(account2 IS Account) -[IS owner]-> (owner IS Person|Company)
WHERE p.name = 'Nikita'
COLUMNS (owner.name AS account_holder, t.amount)
)
GROUP BY account_holder
```

Expand Down

0 comments on commit 16baa72

Please sign in to comment.