0Pricing
Neo4j Graph Database Fundamentals · Lesson

Filtering and Ordering Results

Utilize WHERE and ORDER BY clauses to refine your query results, ensuring you retrieve precisely the data you need.

Refine Your Graph Queries

When working with large graphs, you often need to find very specific information or present it in a particular order.

  • Filtering helps you narrow down results to only what's relevant.
  • Ordering helps you sort your results for better readability or analysis.

In this lesson, we'll master the WHERE and ORDER BY clauses in Cypher.

Filter Results with WHERE

The WHERE clause is used to filter patterns or properties based on specific conditions. It typically comes after a MATCH clause.

Think of it like saying: "Find me all people, WHERE their birth year is 1970."

MATCH (p:Person)
WHERE p.born = 1970
RETURN p.name AS Name, p.born AS BornYear

All lessons in this course

  1. Filtering and Ordering Results
  2. Aggregation and Projections
  3. Updating and Deleting Graph Data
  4. Combining Queries with WITH and UNION
← Back to Neo4j Graph Database Fundamentals