Skip to content

Commit

Permalink
Create q5.gsql
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxiw authored Jan 21, 2025
1 parent a740697 commit 94227ac
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions demos/guru_scripts/docker/tutorial/4.x/script/q5.gsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
USE GRAPH financialGraph

CREATE OR REPLACE QUERY q5 (/* parameters */) SYNTAX V3 {

SumAccum<INT> @cnt = 0; //local accumulator
SumAccum<INT> @@hasPhoneCnt = 0; //global accumulator

// ~[]~ is an undirected edge.
S = SELECT a
FROM (a:Account) ~ [e:hasPhone] ~ (p:Phone)
WHERE a.isBlocked == FALSE
ACCUM a.@cnt +=1,
p.@cnt +=1,
@@hasPhoneCnt +=1;

PRINT S;
PRINT @@hasPhoneCnt;

}

interpret query q5()

0 comments on commit 94227ac

Please sign in to comment.