SKIP
SKIP
defines from which row to start including the rows in the output.
By using SKIP
, the result set will get trimmed from the top.
Please note that no guarantees are made on the order of the result unless the query specifies the ORDER BY
clause.
SKIP
accepts any expression that evaluates to a positive integer and does not refer to nodes or relationships.
Skip first three rows
To return a subset of the result, starting from the fourth result, use the following syntax:
MATCH (n)
RETURN n.name
ORDER BY n.name
SKIP 3
The first three nodes are skipped, and only the last two are returned in the result.
n.name |
---|
|
|
Rows: 2 |
Return middle two rows
To return a subset of the result, starting from somewhere in the middle, use this syntax:
MATCH (n)
RETURN n.name
ORDER BY n.name
SKIP 1
LIMIT 2
Two nodes from the middle are returned.
n.name |
---|
|
|
Rows: 2 |
Using an expression with SKIP
to return a subset of the rows
SKIP
accepts any expression that evaluates to a positive integer, as long as it can be statically calculated (i.e. calculated before the query is run).
MATCH (n)
RETURN n.name
ORDER BY n.name
SKIP 1 + toInteger(3*rand())
Skip the first row plus randomly 0, 1, or 2. So randomly skip 1, 2, or 3 rows.
n.name |
---|
|
|
|
|
Rows: 4 |
Was this page helpful?