I have a problem with the following query (using 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) ;
But unfortunately I receive this error message:
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
I understand that nbr is a "record" and my node_id an integer. But if a try to cast nbr in integer (with nbr::integer) the following message appear :
ERROR: cannot cast type record to integer
Does someone know how to resolve this problem?