从网上找的代码是
select ST_Length(Geography(ST_GeomFromText('LINESTRING(120.451737 36.520975,120.455636 36.520885)')));
/*报错语句: ERROR: invalid reference to FROM-clause entry for table sc*/
select sc.*,dis.distance
from bus_service_center sc,(select ST_Length(Geography(ST_GeomFromText('LINESTRING(117.075591 36.689051,'||sc.longitude||' '||sc.latitude||')'))) as distance) dis
where sc.operation_status = 'ENABLED' order by distance limit 15 offset (0 * 15)
直接查询是没问题的, 但是想把LINESTRING里的坐标换成字段引用的话就报错了, How To 办?