Were you able to solved it? I have similar problem and I find it difficult.
my query goes like this.
SELECT $owner.ID as Owner, @rid as Fleet FROM (
SELECT expand(out('eOwner').in('eOwnedItem')[@class='vFleet']) FROM
vCompany WHERE TopicID in [193569, 172076]
LET $owner = (SELECT @rid as ID FROM $current)
)
The problem is the the value of $owner.ID will always be the rid of the 2nd
record.
On Thursday, September 13, 2012 at 10:51:29 AM UTC+8, Adolfo Rodriguez
wrote:
>
> Hi, I am missing a wiki entry about Nested Queries (sorry if already
> exists). I was trying to find out what is their current implementation
> state.
> * I know that Nested Queries can be used for the *pivot class*.
> * I am not sure if they can be already used in *projections *(as I have
> not found any example on that).
> * Not sure if they can be used in the *WHERE clause*.
>
> I have the necessity to write an advanced projection. Initially I though
> of a expression as in[label='kkkkk'].in.out[label='aaaaa'].... However, the
> particularity of my case is that, vertices, should not be selected by
> attributes of intermediate edges (as in [label='kkkkk']) but from
> attributes of target vertices themselves. I can not figure out a clean
> syntax with 'in.out.in.out.in' expressions for this purpose.
>
> As an alternative, I was thinking about nested queries in projections,
> something as
> select name, (select date from *in.out* where date > 'today - 7') as
> values from....
> At the end, an 'in.out.in.out.in' expression is basically a nicer and
> handy syntax for a query. For more complicated cases, the advantage of a
> Nested Query over an 'in.out.in.out.in' expression is the power provided
> by the where clause and their own projections. Are Nested Queries already
> available for projections? What are the possible pivot classes of those
> Nested Queries.
>
> If this case could be solved I think is another use case that could be
> added to the wiki below Pivoting with query
> <http://code.google.com/p/orient/wiki/PivotingWithQuery>, both as
> children (as examples) of a Nested Query entry.
>
> Another alternative would be a Gremlin function (but it worries me about
> performance) and just another option would be a custom function (which has
> the problem to be configured for every OrientDB upgrade).
>
> So, what is the current state for Nested queries on projections?
>
> Thanks,
>
> Adolfo
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.