Skip to content

Commit

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

CREATE OR REPLACE QUERY q6 (/* 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 q6()

0 comments on commit 73d52be

Please sign in to comment.