Hey 

once I saw your query there I went into my db and started making some 
tests.  I've got a few questions :
 - is that query working ?
 - what is expected of it ? To return all Posts wrote by 14:0 belonging to 
17:1  ,  or returning just one ? 
 - what version of orientdb are you using?

The reason I'm asking : 
https://groups.google.com/forum/#!topic/orient-database/fbZEimTyJjM


On Thursday, January 15, 2015 at 1:54:54 PM UTC, Marcel Pitch wrote:
>
> Hi all,
>
> For some features of my application, I had to write queries allowing me to 
> get part of graph.
>
>
> Here's an example :
>
>
> <https://lh6.googleusercontent.com/-Wiot4OaIQ3g/VLfDYqjE2jI/AAAAAAAAABo/tp__qtqSn74/s1600/SELECT.PNG>
> Imagine a case where we must get, just in ONE query :
>
> - *User*.name
> - *Picture*.url
> -* Post*.message          *!!! But only for the Category #17:1*
> -* Comment*.message  *!!! But only for a Post of Category #17:1*
>
> That's the way I imagine this request :
>
> SELECT
>      name,
>      first(out('HAS_PICTURE')).url,
>      $Post.message,
>      set($Post.out('HAS_COMMENT').message)
> FROM
>      #14:0
> LET
>      $Post = (
>           SELECT 
>           FROM 
>           (
>                SELECT 
>                     expand(out('WROTES')) 
>                FROM 
>                     $parent.$current
>           ) 
>           WHERE 
>                first(out('HAS_CATEGORY')).@rid = format('#17:1')
>        )
>
> But I think there may be an other way to write it...
>
>
> How you would write this query?
>

-- 

--- 
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.

Reply via email to