Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
404 views

Using subquery in WHERE makes query extremely slow

I have this rather basic query that is very slow for reasons I can't figure out: SELECT s.id FROM segments s WHERE ST_DWithin( s.geom::GEOGRAPHY, ST_Envelope((SELECT ST_COLLECT(s2....
Jukurrpa's user avatar
  • 193
2 votes
1 answer
3k views

How to make a single row result query to return multiple rows

I have the following WITH SQL Query which does select a set of filling stations along a route within the distance of 1000m. To have the measurement in meter I cast the geometries to geography. I also ...
Benjamin's user avatar
  • 298
-2 votes
1 answer
3k views

Postgres: how to use subquery correctly?

I have the following query CREATE TABLE test_buffslip AS SELECT ST_INTERSECTS( (SELECT ST_Buffer(geom, 0.005) FROM segments where class = 7) ,geom) FROM segments; Resulting in: ERROR: ...
LarsVegas's user avatar
  • 107
4 votes
1 answer
775 views

Unable to send WHERE parameters to subquery

I have the following problem (in PostgreSQL in combination with PostGIS): I have the following nice query who clusters multiple records. Although it uses PostGIS function, my problem is not PostGIS ...
kwarts's user avatar
  • 49