Search code examples
attributesextractorientdb

Extract in, out in OrientDB query


I have a query in OrientDB as:

select in, out from E_Employe
  • "in" is the link to a vertex from class "User";
  • "out" is the link to a vertex from class "Company";
  • "E_Employee" is the edge between "User" and "Company".

I need to put instead of "in" some attributes from "User" (for example "username", "email"), and instead of "out", some attributes from "Company" (for example, "name", "address"), and I don't know how to do it.


Solution

  • You can just use dot notation:

     select 
        in.username as name, in.email as email, 
        out.name as companyName, out.address as companyAddress 
     from E_Employe