Absolute beginner with GSQL

237 views
Skip to first unread message

Loïc

unread,
Feb 6, 2020, 5:08:17 PM2/6/20
to gsql-...@opengsql.org
Hello,

I am a beginner level 0 with GSQL/TigerGraph and I am trying to follow the GSQL101 tutorial in GraphStudio. https://docs.tigergraph.com/intro/gsql-101/built-in-select-queries
In the tutorial the queries are supposed to be run on GSQL Shell that we don't have in GraphStudio.
Whereas, I am trying to convert the Query in a CREATE QUERY in GraphStudio. I
don't understand why "SELECT count(*) FROM person" shows up an error about count(*).

CREATE QUERY test() FOR GRAPH social {
   Result = SELECT count(*) FROM person
  PRINT Result;
}


Could you please explain me the difference between the Queries that can be made in GSQL Shell & the ones in GraphStudio ?

Thank you for your help.

Loïc
Message has been deleted

Jonathan Herke

unread,
Feb 6, 2020, 6:01:01 PM2/6/20
to Loïc, gsql-users
If you are getting started I would check out the community groups (Below). There are TigerGraph developers there that can give you some immediate feedback.

Connect with the TigerGraph Community:
Community Fourm: https://www.reddit.com/r/tigergraph/

Going back to the count query you could do the following using a SumAccum. Accumulators are pretty powerful feature that you can use to do some complex logic. For more information on them, I would check out https://docs.tigergraph.com/intro/accumulators-tutorial#what-is-an-accumulator

CREATE QUERY test() FOR GRAPH social  { 
   SumAccum<INT> @@vertexCNT;
   
   start= {person.*};
   find = SELECT v FROM start:v
            ACCUM @@vertexCNT += 1;
 
   PRINT @@vertexCNT;
}
Jon Herke
Developer/Technical Evangelist, TigerGraph



--
Welcome to GSQL-user group.
- our mission is bringing the power of graph databases to everyone www.opengsql.org
- technical resource can be found here https://docs.tigergraph.com/
---
You received this message because you are subscribed to the Google Groups "gsql-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gsql-users+...@opengsql.org.
To view this discussion on the web visit https://groups.google.com/a/opengsql.org/d/msgid/gsql-users/108c92c8-1d99-4a12-8536-aa9429e173da%40opengsql.org.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages