The following works as well:

select @rid, in('EdgeType').size() as edge_count from VertexType order by 
edge_count desc limit by 20

Note that the edge collection size is retrieved using the function, not the 
literal field name.
Also, you have to select "@rid" explicitly because the @RID field that 
comes back is a fake rid.  You then need to retrieve the field "rid" from 
your results (or give it an alias and use that) instead of @rid.

I don't know why it's a fake rid though since this query results in actual 
records, not composite or "fake" ones.


On Monday, August 25, 2014 1:47:02 PM UTC-4, [email protected] 
wrote:
>
> Hi,
>
> This works beautifully but the @rid comes out wrong and looks like a 
> temporary #-2:282 
> <http://localhost:2480/studio/index.html#/database/mobilitus/browse/edit/-2:282>
>  rid.
>
> Any ideas?
>
> Regards,
>  -Stefán
>
>
> On Monday, 25 August 2014 17:35:48 UTC, Lvc@ wrote:
>>
>> Hi Stefan, try something like:
>>
>> SELECT FROM VertexType LET $edge_count = in('EdgeType').size() ORDER BY 
>> $edge_count DESC LIMIT 20
>>
>> Lvc@
>> ᐧ
>>
>>
>> On 25 August 2014 19:28, <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> How can I select vertexes with the highest number of outgoing edges of a 
>>> particular type?
>>>
>>> something like the following comes to mind but does not work:
>>>
>>> select count(in_EdgeType) as edge_count from VertexType order by 
>>> edge_count desc limit by 20
>>>
>>>
>>> Regards,
>>>  -Stefán 
>>>
>>>
>>>  -- 
>>>
>>> --- 
>>> 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