OrientDB创建GroupBy表

OrientDB创建GroupBy表,orientdb,orientdb2.2,orientdb-2.1,Orientdb,Orientdb2.2,Orientdb 2.1,例如,我有下表 [id, V1, V2] [A , 1 , 5] [A , 2 , 4] [A , 3 , 3] [A , 4 , 2] [B , 9 , 6] [B , 8 , 7] [B , 7 , 8] [B , 6 , 9] 我想创建具有以下结果的查询 [id, V1` , V2` ] ] [A , [1,2,3,4] , [5,4,3,2] ] [B , [9,8,7,6] , [6,7,8,9] ] 或 如何构造此查询? 我尝试了很多选择,但都失败了 任何帮助

例如,我有下表

[id, V1, V2]
[A , 1 , 5]
[A , 2 , 4]
[A , 3 , 3]
[A , 4 , 2]
[B , 9 , 6]
[B , 8 , 7]
[B , 7 , 8]
[B , 6 , 9]
我想创建具有以下结果的查询

[id,     V1`   ,    V2`  ] ]
[A , [1,2,3,4] , [5,4,3,2] ]
[B , [9,8,7,6] , [6,7,8,9] ]

如何构造此查询? 我尝试了很多选择,但都失败了

任何帮助都将受到感谢。 提前感谢

试试这个:

select id, $a.V1 as V1, $a.V2 as V2 from <class name>
let $a = (select from <class name> where $parent.current.id = id)
group by id
希望能有帮助


关于

非常感谢,它很有效,这正是我所做的,我必须说我想给出一个答案并看到您的解决方案。这不是你第一次帮助我,谢谢你一直以来都是我的荣幸
select id, $a.V1 as V1, $a.V2 as V2 from <class name>
let $a = (select from <class name> where $parent.current.id = id)
group by id