Skip to content

Commit

Permalink
Update q2a.gsql
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxiw authored Sep 12, 2024
1 parent d322609 commit 8e570e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demos/guru_scripts/docker/tutorial/4.x/script/q2a.gsql
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
USE GRAPH financialGraph

CREATE OR REPLACE QUERY q2a (string accntName) SYNTAX v3 {
CREATE OR REPLACE QUERY q2a () SYNTAX v3 {

//think the FROM clause is a matched table with columns (a, e, b)
//you can use SQL syntax to group by the source and target account, and sum the total transfer amount
SELECT a, b, sum(e.amount) INTO T
FROM (a:Account {name: accntName})-[e:transfer]->(b:Account)
FROM (a:Account)-[e:transfer]->(b:Account)
GROUP BY a, b;

//output the table in JSON format
Expand All @@ -17,4 +17,4 @@ CREATE OR REPLACE QUERY q2a (string accntName) SYNTAX v3 {
install query q2a

#run the query
run query q2a("Scott")
run query q2a()

0 comments on commit 8e570e4

Please sign in to comment.