SELECT
SELECT provides a projection-first query form. A graph source supplies the graph for its MATCH pattern.
SELECT p.name AS name, p.age AS ageFROM social MATCH (p:Person)WHERE p.age >= 30ORDER BY name;FROM { query } reads an independent nested result. FROM graph { query } also supplies a graph context. The nested query exports its projected names to the outer query.
SELECT score, COUNT(*) AS frequencyFROM { FOR score IN [10, 10, 20] RETURN score }GROUP BY scoreHAVING COUNT(*) > 1;WHERE filters source rows; HAVING filters aggregate groups. ALL/DISTINCT, GROUP BY (), output aliases and ordering are supported. A nested query cannot reference bindings from the outer query: correlated evaluation is not implemented.
See grouping and nested queries.