OrientDB SELECT and subqueries

I am really puzzled by this. Why does it work:

SELECT out('Posted').out('IsFromCategory') FROM #18:1

And this is not so:

SELECT out('IsFromCategory') FROM (SELECT out('Posted') FROM #18:1)

This is not my real logic, but I came up with something by doing some tests ...

+4
source share
1 answer

As you understand, you need to use expandin your subquery so that it looks like

SELECT out('IsFromCategory') FROM (SELECT expand(out('Posted')) FROM #18:1)

It, like the subquery without expand, returns a list @rid, so there is nothing to choose, and after the extension you get a list with all the entities (vertices) from which you can move along any edge they have.

( , , . , - , , - , , , ).

+3

All Articles