Figure out what you are looking for: persons? Then you'll need:
SELECT FROM Person

Now, what are you looking for: name and cars for each Person:
SELECT name, out('drives').name as cars FROM Person

Please note that cars is a collection, since one Person may be related from
zero to many cars.

Cheers,
   Riccardo


2014-03-17 13:34 GMT+01:00 Vikas Iyengar <[email protected]>:

> Hi All,
>
> I am new to OrientDB and have following structure:
>
> 1) Vertex - Person - Luca, Jay, Tom, Henry
> 2) Vertex - Car - Ferrari, Audi, Chevrolet
> 3) Vertex - Restaurant - Dante, McD, Hyatt
> 4) Edge - Eats -
>                Luca -> Eats-> Dante,
>                Luca -> Eats-> McD
>                Jay -> Eats -> McD
>                Tom -> Eats -> Dante
>                Henry -> Eats -> Dante
> 5) Edge - Drives -
>                Luca -> Drives -> Audi
>                Luca -> Drives -> Ferrari
>                Jay -> Drives -> Chevrolet
>                Tom -> Drives ->Audi
>                Henry -> Drives -> Ferrari
>                Henry -> Drives -> Chevrolet
>
> Now, i want to write a SQL that lists the name of the Person and the Car
> they Drive,  who eat at Dante
>
> I tried, "Select expand(in('Eats').out('Drives')) from Restaurant where
> name = 'Dante' "
>
> This only prints the name of the Cars, not the name of the Person.
>
> Please, help me with the same.
>
>  --
>
> ---
> 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