Hello, 

I have created some edges and some vertex and i built the following query which 
works.

select flatten(dijkstra) from (select dijkstra( (select from City where 
name='A'), (select from City where name='I'), 'weight' ))

orientdb {db=path_finderC}> select flatten(dijkstra) from (select dijkstra( 
(select from City where name='A'), (select from City where name='I'), 'weight' 
))                                                      

----+------+------+----+-----------+----------
#   |@RID  |@CLASS|name|out_Estrada|in_Estrada
----+------+------+----+-----------+----------
0   |#11:10|City  |A   |[size=1]   |null      
1   |#11:11|City  |B   |[size=2]   |[size=1]  
2   |#11:14|City  |E   |[size=2]   |[size=2]  
3   |#11:15|City  |F   |[size=1]   |[size=1]  
4   |#11:16|City  |G   |[size=1]   |[size=1]  
5   |#11:17|City  |H   |[size=1]   |[size=1]  
6   |#11:18|City  |I   |null       |[size=2]  
----+------+------+----+-----------+----------

However, i must know the total "weight" sum from A to I. So how can i make a 
djikstra query and get the sum from A to I ? And have a result, for example 
like:

----+------+------+----+-----------+----------
#   |@RID  |@CLASS|name|out_Estrada|in_Estrada| from to weight
----+------+------+----+-----------+----------
0   |#11:10|City  |A   |[size=1]   |null      
1   |#11:11|City  |B   |[size=2]   |[size=1]       A to B 10
2   |#11:14|City  |E   |[size=2]   |[size=2]       B to E 15
3   |#11:15|City  |F   |[size=1]   |[size=1]       E to F 24
4   |#11:16|City  |G   |[size=1]   |[size=1]       F to G 32
5   |#11:17|City  |H   |[size=1]   |[size=1]       G to H 22
6   |#11:18|City  |I   |null       |[size=2]       H to I 32
----+------+------+----+-----------+----------

or

----+------+------+----+-----------+----------|
#   |@RID  |@CLASS|name|out_Estrada|in_Estrada|Total
----+------+------+----+-----------+----------|
0   |#11:10|City  |A   |[size=1]   |null      |750
1   |#11:11|City  |B   |[size=2]   |[size=1]  |750
2   |#11:14|City  |E   |[size=2]   |[size=2]  |750
3   |#11:15|City  |F   |[size=1]   |[size=1]  |750
4   |#11:16|City  |G   |[size=1]   |[size=1]  |750
5   |#11:17|City  |H   |[size=1]   |[size=1]  |750
6   |#11:18|City  |I   |null       |[size=2]  |750
----+------+------+----+-----------+----------|


Or give me some suggestion to calculate the sum of all "weights"

-- 

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