This is SQL’s
We just put it in the end because it felt better to have it there — you do a lot of matching and filtering, and finally, you return something.
Aggregate queries work just like they do in SQL, apart from the fact that there is no explicit
GROUP BY clause.
Everything in the return clause that is not an aggregate function will be used as the grouping columns.
SELECT "Person".name, count(*) FROM "Person" GROUP BY "Person".name ORDER BY "Person".name
MATCH (person:Person) WHERE HAS (person.name) RETURN person.name, count(*) ORDER BY person.name
Order by is the same in both languages —
ORDER BY expression
Nothing weird here.