概述
使用语句SKIP
从数据开头舍弃指定数量的记录。
语法
SKIP <N>
详情
<N>
为非负整数
示例图集
在一个空图集中,逐行运行以下语句,创建示例图集:
create().node_schema("student").node_schema("course").edge_schema("takes")
create().node_property(@*, "name").node_property(@student, "age", int32).node_property(@course, "credits", int32)
insert().into(@student).nodes([{_id:"S1", name:"Jason", age:25}, {_id:"S2", name:"Lina", age:23}, {_id:"S3", name:"Eric", age:24}, {_id:"S4", name:"Emma", age:26}, {_id:"S5", name:"Pepe", age:24}])
insert().into(@course).nodes([{_id:"C1", name:"French", credits:4}, {_id:"C2", name:"Math", credits:5}])
insert().into(@takes).edges([{_from:"S1", _to:"C1"}, {_from:"S2", _to:"C1"}, {_from:"S3", _to:"C1"}, {_from:"S2", _to:"C2"}, {_from:"S3", _to:"C2"}, {_from:"S4", _to:"C2"}, {_from:"S5", _to:"C2"}])
跳过N条记录
find().nodes({@student}) as n
skip 2
return n.name
结果:
n.name |
---|
Eric |
Emma |
Lina |
跳过N条有序记录
find().nodes({@student}) as n
order by n.age
skip 2
return n.name
结果:
n.name |
---|
Pepe |
Jason |
Emma |