在或接近或接近' select'的语法错误问题

发布于 2025-02-06 10:52:34 字数 437 浏览 2 评论 0原文

我正在尝试编写有关如何创建等距的编码,这是我的代码:

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;

我遇到的错误如下:

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

有人可以帮助我吗?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫弦 2025-02-13 10:52:34

欢迎来到。

您正在使用错误的字符引用选择字符串。使用单个引号'代替

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;

另请参阅 dollar-quoted字符串

注意:如果您使用的是pgrouting 3.0+,请检查 pgr_alphashape

Welcome to SO.

You're using a wrong character to quote the SELECT string. 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

Note: if you're using pgRouting 3.0+ please check pgr_alphaShape

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文