Hi Khaled,

in OrientDB 2.0.x you can just do

select userID, out("Likes").movieID from User

but you will obtain


userID     |    movieID
============================
1          |       [2, 10]
2          |       5


In OrientDB 2.1 there is a new function called UNWIND that will give you
exactly the result you expect:

select userID, out("Likes").movieID from User unwind movieID

Regards

Luigi


2015-05-08 14:05 GMT+02:00 Khaled Bakhit <[email protected]>:

> Dear all,
>
> I need some helping writing a basic query against my graph database. I'm
> pretty new to Orient SQL, and some guidance would be really appreciated.
>
> I have the following Vertices/Edges:
>
>
> User (userID)  --- Likes ----->  Movie ( movieID)
>
>
> I want to know for each userid in User, which movieid did he like? And
> have the result look like this:
>
> Userid     |    Artist ID
> ============================
> 1          |       2
> 1          |       10
> 2          |       5
>
>
> Thank you for your help.
>
>
>
>
>  --
>
> ---
> 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.
>

-- 

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