OrientDB group by query using graph

你。 提交于 2019-12-07 16:58:25

Solved it! In OrientDB 2.1 (I'm trying rc4) there's a new clause called UNWIND (see SELECT in docs).

Using UNWIND I can do:

SELECT sum(property), groupOn from (
  SELECT property, out('references') as groupOn
  FROM AClass
  UNWIND groupOn
) WHERE groupOn.out('definedBy')=F
GROUP BY groupOn

It could potentially be a slow function depending on the number of vertices of AClass and its references, I'll report back if I find any performance issues.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!