Basic GROUP BY Syntax error

GSQL > SELECT name, sum(hits) FROM dapp group by name;

I get following error while executing above query.

“The specified Identifier ‘sum’ is a reserved keyword, please use another one.” , I want to use count aggregation using group by. How to get rid of this error?

Perhaps stating the obvious here, but you should be using version 3.1 to get the group by clause.

Also, are name and hits attributes of the dapp vertex? Please provide more details so we can help.

For example

SELECT p.name, sum(p.hits) FROM dapp:p GROUP BY p.name

1 Like

Query worked with SYNTAX V2. Error message was confusing.