Understanding a complex query in pgrouting

المشرف العام

Administrator
طاقم الإدارة
I am new to pgrouting and basically am familier with sql and postgresql, i came across the following command below:

SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, source::integer, target::integer, length::double precision AS cost FROM ways', 30, 60, false, false);I am used to seeing sql statements as below:

SELECT param1 , param2 But i am thrown off the hook when i see something like:

SELECT seq, id1 AS node, id2 AS edgeWhat's with the AS part ?

Also is the below a subquery ?? and can somebody explain it ? I am not very clear with the below query.

(' SELECT gid AS id, source::integer, target::integer, length::double precision AS cost FROM ways',30, 60, false, false);Got the above query from HERE.

Thank you.

Alex-z.



أكثر...
 
أعلى