SKIP & LIMIT Clauses
Overview
The SKIP
and LIMIT
clauses control result pagination in Cypher queries:
SKIP
omits a specified number of initial resultsLIMIT
restricts the total number of returned results
These clauses are typically used together with ORDER BY
for consistent pagination.
SKIP
and LIMIT
clause can only appear in RETURN
and WITH
clauses.
Syntax
[SKIP <integer>]
[LIMIT <integer>]
Examples
Basic pagination:
MATCH (p:Person)
RETURN p.name
ORDER BY p.name
SKIP 20
LIMIT 10
Top N results:
MATCH (product:Product)
RETURN product
ORDER BY product.price DESC
LIMIT 5
Last updated on