【发布时间】:2014-12-15 20:24:56
【问题描述】:
我对以下查询有疑问(使用 PostgreSQL)
DELETE FROM node
WHERE node.node_id IN
(
SELECT nbr
FROM
(
SELECT node.node_id
FROM node, edge_data
WHERE ST_intersects(node.geom, edge_data.geom)
) as nbr
GROUP BY nbr
HAVING COUNT(*) = 2) ;
但不幸的是,我收到此错误消息:
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
********** Erreur **********
ERROR: operator does not exist: integer = record
我知道 nbr 是一个“记录”,而我的 node_id 是一个整数。但是,如果尝试将 nbr 转换为整数(使用 nbr::integer),则会出现以下消息:
ERROR: cannot cast type record to integer
有人知道如何解决这个问题吗?
【问题讨论】:
标签: postgresql casting integer record