I have written the below query to retrieve movie and corresponding rating:
movie
rating
match (rvwr:Person)-[r:REVIEWED]->(m:Movie) where m.released > 2003 return m.title, sum(r.rating)/count(r) as rating
I want to confirm if there is a need to use anything similar to groupby clause.
groupby clause
Groupby is done implicitly by all of the aggregate functions. This statement is semantically equivalent to groupby for m.title. Note that all columns not contained within the aggregate function will be the groupby keys.
m.title
Thanks. In that case, how groupby is performed when we have more than 2 columns?
return p2.name, p2.born, sum(r.earnings)/count(p2)