简体   繁体   English

'select' 处或附近的语法错误问题

[英]Problem with syntax error at or near 'select'

I'm trying to code about how to create isochrones, this is my code:我正在尝试编写有关如何创建等时线的代码,这是我的代码:

SELECT i As time_access,
ST_SetSRID(pgr_pointsAsPolygon(
‘SELECT id, ST_X (geom) AS x, ST_Y (geom) As y
FROM dd_caserne
WHERE access_time <= ‘|| i :: text), 4326) As geom
FROM generate_series(60,300,60)
As i
ORDER BY i DESC;

And the error I am getting is as follows:我得到的错误如下:

ERROR:  syntax error at or near "id"
LINE 4: ‘SELECT id, ST_X (geom) AS x, ST_Y (geom) As y

can someone help me ?有人能帮我吗 ?

Welcome to SO.欢迎来到 SO。

You're using a wrong character to quote the SELECT string.您使用了错误的字符来引用SELECT字符串。 Use single quotes ' instead of ´ :使用单引号'而不是´

SELECT 
  i AS time_access,
  ST_SetSRID(pgr_pointsAsPolygon(
    'SELECT id, ST_X(geom) AS x, ST_Y(geom) AS y
     FROM dd_caserne WHERE access_time <= '|| i::text), 4326) AS geom
FROM generate_series(60,300,60) AS i
ORDER BY i DESC;

See also dollar-quoted strings另请参阅dollar-quoted strings

Note : if you're using pgRouting 3.0+ please check pgr_alphaShape注意:如果您使用 pgRouting 3.0+,请检查pgr_alphaShape

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM