概述
SKIP子句将别名代表的数据行的前N行数据舍弃。
语法
SKIP <N>
<N>
为舍弃的行数,应为正整数
例如,将以下路径查询产生的数据流path的前2行舍弃:
![](https://img.ultipa.cn/draw/draw_4c91c9a34fa442719545ba8af111be0f.jpg?v='1703130961618')
n([1, 5]).e()[:2].n() as path
skip 2
return path
示例
示例图集
![](https://img.ultipa.cn/draw/draw_fd8656adf7c843908a8228941a425401.jpg?v='')
在一个空图集中,依次运行以下各行语句创建示例图集:
create().node_schema("student").node_schema("course")
create().node_property(@*, "name").node_property(@student, "age", int32).node_property(@course, "credit", int32)
insert().into(@student).nodes([{_id:"S001", _uuid:1, name:"Jason", age:25}, {_id:"S002", _uuid:2, name:"Lina", age:23}, {_id:"S003", _uuid:3, name:"Eric", age:24}, {_id:"S004", _uuid:4, name:"Emma", age:26}, {_id:"S005", _uuid:5, name:"Pepe", age:24}])
insert().into(@course).nodes([{_id:"C001", _uuid:6, name:"French", credit:4}, {_id:"C002", _uuid:7, name:"Math", credit:5}])
insert().into(@default).edges([{_uuid:1, _from_uuid:1, _to_uuid:6}, {_uuid:2, _from_uuid:2, _to_uuid:6}, {_uuid:3, _from_uuid:3, _to_uuid:6}, {_uuid:4, _from_uuid:2, _to_uuid:7}, {_uuid:5, _from_uuid:3, _to_uuid:7}, {_uuid:6, _from_uuid:4, _to_uuid:7}, {_uuid:7, _from_uuid:5, _to_uuid:7}])
一般用法
本例查找@student点,除去年龄最小的2名学生后,返回学生的name属性:
find().nodes({@student}) as n
order by n.age
skip 2
return n.name
Eric
Jason
Emma