diff --git a/demos/guru_scripts/docker/tutorial/4.x/script/q6.gsql b/demos/guru_scripts/docker/tutorial/4.x/script/q6.gsql new file mode 100644 index 00000000..84743f80 --- /dev/null +++ b/demos/guru_scripts/docker/tutorial/4.x/script/q6.gsql @@ -0,0 +1,21 @@ +USE GRAPH financialGraph + +CREATE OR REPLACE QUERY q6 (/* parameters */) SYNTAX V3 { + + SumAccum @cnt = 0; //local accumulator + SumAccum @@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()