Is there no way to use use the MATCH command ? the thing is that i can end 
up with very complex queries (with multiple relations, with different 
depth) which can fast become unreadble with select

Le jeudi 13 avril 2017 14:57:34 UTC+2, Luigi Dell'Aquila a écrit :
>
> Hi Nicolas,
>
> You can try the following query:
>
> SELECT @rid as student, out("has") as mark from (
>    SELECT FROM Student ORDER BY avg_mark DESC LIMIT 3
> ) UNWIND mark
>
> Thanks
>
>
> Luigi
>
>
> 2017-04-13 14:15 GMT+02:00 nicolas treiber <[email protected] 
> <javascript:>>:
>
>> Hi.
>> I'm pretty sure that what i want to do is not possible but maybe someone 
>> has a workaround (or it may give ideas to implement in future versions).
>> Imagine you have a class Student with their average mark, and a class 
>> Mark. Every student a multiple marks.
>> What I would like to do is get the three best students with their marks.
>> I thought of something like: SELECT FROM (MATCH {class: Student, as: 
>> s}-has->{class: Mark, as: m}) ORDER BY s.avg_mark LIMIT 3
>> But of course it only returns 3 results (so for example if all students 
>> has 10 marks, i would only get that first student with 3 marks instead of 3 
>> students with 10 marks each).
>> Any idea ?
>>
>> -- 
>>
>> --- 
>> 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] <javascript:>.
>> 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