Sql Query in Postgresql

المشرف العام

Administrator
طاقم الإدارة
Hello i try to execute a query but i stack. I have two tables A,B. The a table has columns gid, geometry(line-string) and an empty column value, the B table has got 3 columns gid,geometry(Point) and km. I want to find fro the a table the start and end point of every line-string and compare with the points of table B if the start and end points of line-string is mach with points from table B then i want to find the odds of value of X from the value of Y and save it in the empty column of table A.

I write this query but i stack.

SELECT ST_X(ST_StartPoint(ST_AsText(ST_Transform(geom,4326)))) As startX , ST_Y(ST_StartPoint(ST_AsText(ST_Transform(geom,4326)))) As startY , ST_X(ST_EndPoint(ST_AsText(ST_Transform(geom,4326)))) As endX , ST_Y(ST_EndPoint(ST_AsText(ST_Transform(geom,4326)))) As endY , ST_X(ST_AsText(ST_Transform(geo,4326))) As X , ST_Y(ST_AsText(ST_Transform(geo,4326))) As Y FROM r R INNER JOIN e E ON (R.startX=E.X AND R.startY=E.Y) OR (R.endX=E.X AND R.endY=E.Y);

أكثر...
 
أعلى